User Profile & Activity

Scott French Member
Page
of 4

Hi Handy,

It looks like this version of the grid requires a '<ClientBindingSettings></ClientBindingSettings>' tag when you are using client side binding. In our previous examples this tag was commented out and everything ran. We added this tag along with PreloadGroupTotals & GroupRowPageSize and the page started loading correctly. We haven't had a chance to fully evaluate but it does look like the PreloadGroupTotals is working. GroupRowPageSize on the other hand doesn't seem to do anything. We set this to 50 then 100 then 200 but it does not seem to affect the group paging. The groups still try to load the entire collection of rows so we are still getting the script error. Is there anything else we need to do to implement GroupRowPageSize?

Thanks,
Scott French

Hi Handy,

Thanks for the update. I upgraded two different branches of our dev environment with the new hotfix but in both I am now getting the error below when I try to open a page with a client binding grid.

[NullReferenceException: Object reference not set to an instance of an object.]
   ISNet.WebUI.ISNetControl.ShouldReturnJson() +98
   ISNet.WebUI.ISNetControl.ControlRequestHandler(Object sender, EventArgs e) +188
   System.EventHandler.Invoke(Object sender, EventArgs e) +0
   System.Web.UI.Control.OnPreRender(EventArgs e) +8684342
   System.Web.UI.Control.PreRenderRecursiveInternal() +80
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842

The page loads fine initially but the grid looks to be thinking for a second or so and flashes the line "Loading dataset from Server" in the status area at the bottom left. Then this error pops up in the standard webgrid error window. Maybe this is because we only have R1?

Thanks,
Scott French

Posted: February 4, 2010 7:46 PM

Hi Andi,

Imagine this situation. A user visits the page in order to post 50 very similar looking rows that have been stored in a spreadsheet. They will copy these rows then paste them into the grid. Here is our problem, we do not want the grid to drop rows with bad values because it may be very hard to tell which rows have been dropped. If the user pastes 50 rows but only 30 show up in the grid how are they to know which rows contained the bad values? How will they know which cells within the row require correction? We want the rows to be inserted into the grid but have any bad cell values highlighted. We know how to do our own validation, we know how to blank out the bad cells values, we know how to prevent the row from being inserted. We just have no way to keep the row and mark the bad values. Without this functionality we really can't move forward with this setup. Please let me know about marking these cells that contain bad data.

Thanks,
Scott French

Posted: February 2, 2010 10:35 PM

Hi Andi,

We aren't having any trouble getting the values and performing our own validation at the cell level. The problem is once we find out a value is incorrect we have no way to mark the cell or row visually to let the user know a change is required. The other issue that needs to be dealt with eventually is why these incorrect values are allowed to be inserted at all... the rules setup by at the column level should stand as Dan stated in his original post. For now we need some kind of method to mark the values we have tested in our own custom code as invalid. Our testing shows there is no row index or cell index provided for any of the rows are created when a multi-row paste function is performed. That means we couldn't use the code you provided that updated the HTML elements. Now you've confirmed the style element doesn't exist for these mulit-paste rows. Are there any options left for marking these invalid cells?

Thanks,
Scott French

Posted: February 2, 2010 2:20 PM

Hi Andi,

Dan is in meetings today but we wanted to get back to you. We've taken the code you provided and tried to implement it. The problem is we do not know what row/cell indexes we will need to adjust ahead of time. We are doing our validation in the 'OnAddPendingChanges' client side event. We can only access the row using the 'rowChanges' variable. We tried to implement your code using the index values from 'rowChanges' but it is not possible. The cell index does not exist for these cells and these rows always have a position of 0. We tried to assign the style changes directly using rowChanges.Row.Cells.GetNamedItem('CellName').style.backgroundColor = "Red"; but the style attribute does not exist for these pending changes rows, neither does the cellElement attribute. There doesn't seem to be any way to get the index or change the style using OnAddPendingChanges's 'rowChange' attribute. If we are missing something in here please let us know.

Thanks,

Scott French

Posted: February 2, 2010 1:45 PM

Hi Andi,

I've attached a sample that might more clearly represent our issue (Default2.aspx).

In many cases we have text or controls above and below the grid. We want them to be visable without scrolling in the tab. In this sample I've set the intial height to 350px and the WebGrid_OnColumnSort height to 350px. When you load the page the grid is actual 415px tall (this is wrong). After sorting it goes down to 350px tall. It did this even before you added the WebGrid_OnColumnSort call... in fact it would go back to 350px even if you just readjust the page size by resizing the entire Internet Explorer window. Also, this issue only occurs when the grid is in a tab other than the first. You can confirm this by viewing DefaultBetter.aspx.

All of this combined with the fact that we never had a problem before upgrading to 2009 leads me to believe this is a bug, not a configuration issue.

Thanks,
Scott French

Posted: February 1, 2010 3:40 PM

Hi Andi,

Is there anything we can do to prevent this issue? We are using fixed height grids inside a tab in a few situations without a problem but it seems like most act this same way. There are a few scenarios where we do not want the grid to take up the entire height of the grid. Is percentage our only option now? I know in the past we have used pixel dimensions as most of our grids inside a tab are setup this way. We just want to clarify before we start modifying all of these pages...

Thanks,
Scott French

Posted: January 29, 2010 5:11 PM

Hi Handy,

Sorry for the slow reply. We've been dealing with some other issues related to upgrading and haven't had time to come back to this. 'Open in New Window' and 'Open in New Tab' are both built in Internet Explorer options when you right click an HTML link. I've attached an image of our old navigation to show what I mean. Visitors use these options to open a new window in addition to the one they are currently viewing. That way they can compare data in two different pages easily. We'd like to find a way to work something like this into our new implementation (at least the 'New Window' option).

I've also attached a sample project that contains a simplified version of our new navigation. You should be able to unzip this file, open the project in Visual Studio and view DynamicNav.aspx in a Browser window.

Here are the problems we're running into:

1. The WebContextMenu we've added doesn't show up on any of the child menu items. The MenuCommand does display the WebContextMenu but the WebMenuItems do not. How can we make the WebContextMenu display on the MenuCommands and child WebMenuItems?

2. If you right click on any MenuCommand item that has a TargetURL the WebContextMenu is displayed for a quick second, but the link TargetURL is immediately accessed and we leave the page. How do we prevent the TargetURL from being accessed when trying to view the WebContextMenu using a right click?

3. Is there a way to connect the WebMenuBar to the WebContextMenu so the TargetURL we are trying to access in the MenuCommand or WebMenuItem is passed to the WebContextMenu?

or

4. Is there a way to replace the JavaScript items in the MenuCommand and WebMenuItem with real HTML links like '<a href=http://link.com>Text</a>' ? If this was possible we could completely bypass the first three steps as the built in Internet Explorer options for new Tab and new Window would be included by default.

Long term I’m guessing #1-3 are the better options to deal with. Short term #4 would probably be a good fix for us. We’re open to either so any guidance on this would be much appreciated.

Thanks,
Scott French

Posted: January 25, 2010 5:43 PM

Any ideas? Is my issue clear enough? Would a sample help?

Thanks, Glenn. That did the trick. I did modify it slightly for our scenario where some MenuCommands may have children and some may be a direct link. We want the MenuCommands with a link to actually be clicked and not trigger on mouseover.

                if (menuBar.Menus[i].TargetURL == null) {
                    Listener.Add(menuBar.Menus[i]._HtmlObj, "onmouseover", showMenuCommand, menuBar.Menus[i]);
                }
All times are GMT -5. The time now is 12:30 AM.
Previous Next