Super simple setup:
One webgrid attached to an ObjectDataSource, which retrieves the data via Linq from a database. I enabled AJAX for the webgrid.
Now I want the user to select a row, click a button and work with the selected row on Postback. This works fine, as long as the user downt scroll down. When the user does scroll down and new rows are loaded via AJAX and the user selects one of those rows, the returned row on postback is wrong. It is always the last row in the table before the AJAX async callback.
Is use myGrid.DisplayLayout.ActiveRow to retrieve the selected row.
Any tips on what I am doing wrong? Again: if the user selects one of the first rows, it works just fine.....
Hello,
> I use myGrid.DisplayLayout.ActiveRow to retrieve the selected row.
Did you try this in C#, to retrieve the selected row when PostBack?
UltraGridRow selectedRow = myGrid.DisplayLayout.SelectedRows[0];
if (selectedRow != null) { ... }
Have you also searched the old forum, it' s full of good ideas:
http://forums.archive.infragistics.com/readgroup?group=infragistics.products.netadvantage.aspnet.webgrid
Thanks for the input, Walter. I've been banging my head against a wall trying to figure out multi-filtered columns not working properly in AJAX mode -- which we had to go to for proper filter support in paging. Seems to be that AJAX with the UltraWebGrid isn't something that I can trust fully.
Does anyone out there have a solution to avoid using the AJAX mode which still maintaining a slick implementation?
Cheers,Mark.
Thanks so much for your suggestion here. I spent a day wracking my brain before I found this.
Thanks for your reply. This is indeed frustrating. I mean: Isnt retrieving the selected row an important aspect of a table control? And shouldnt this be mentioned at least in the help? This is simply ridicoulous....
I am gonna check out the Telerik controls and see if they are better.
I feel your pain. Literally. I've been feeling this pain for about two months. Getting very frustrated...bug after bug after bug with the webgrid. I had really good luck with the Win version of their controls...not so much with the web.
But, to your question, I had the exact same problem. And I worked with support...there isn't a solution. They said something to the affect "not all features of the grid are supported in Ajax mode". Anyway, I solved the problem by putting my action buttons right in the grid. So instead of selecting a row and clicking "do something"...I put a "Do Something" button on every row. The event fired by that button always contains the correct row. Not sure if this technique will help you or not.
-Walter