Reputation: 8283
We have a gridview with quite a large amount of information (100s or rows and columns) which we need to improve preformance of.
Currently to fix some performance issues we have made the gridview have no edittemplate and instead double clicking on a cell will bring up a dropdown of the available options that is retrieved using webmethods and populated using jquery dynamically, after an option is choosen in the dropdown we set teh value in the html to the value of the selected option.
We are having problems subsequently sending this changes back to the server, we have a button on the page that causes a postback to the server but the changes that we have made via the jquery functionality aren't available when we loop through the gridview items they still have the same values as previous.
Are we going about this the wrong way in terms of populating/updating how can we achieve this?
Aside: I know we should probably limit the bounds of the grid but at the moment this is not an option
Upvotes: 2
Views: 6415
Reputation: 55200
If you would want to improve performance, you must not use.
I am guessing you are using all these.
You could Use jQuery to directly call ASP.NET AJAX page methods, without using ScriptManager at all. Combine this with the power of any of the jQuery Grid recommendations ( here and here ). I am comfortable with DataTables but I am hearing more and more about SlickGrid. You oughta give it a try.
Now that everything is Client Side, there won't be a problem of value getting lost while posting back.
Also, I would strongly recommend that you should not use UpdatePanel at all. But thats just me.
Upvotes: 2
Reputation: 6045
I found this Code "framework" http://www.codeproject.com/KB/ajax/AJAXWasHere-Part1.aspx, It modifies/recreates the ViewState and submits it with the AJAX request so you can still use the event model in ASP.NET. This was an AJAX work around before MS released there own with .NET 2.0.
I use it in conjunction with the mootools JS library so you shouldn't have any issues using it with JQuery, but you wont be able to use the JQuery AJAX Methods unless you re-write the "CallBackObject" as a Jquery plugin.
Regards
Upvotes: 0
Reputation: 35822
When you work with GridView natively, that is, you let it handle the edit template, ViewState gets into the scene and works just fine. But when you manipulate grid manually, no change is reflected in related places, thus having the same values at server. You said that you fetch values on dblclick via jQuery. Why don't you update the row on blur? I mean, when user goes to the next row, simply update the current record via Ajax. That's the most safe approach. Once I had the same experience with Telerik's RadTree. You should:
Upvotes: 2
Reputation: 11
I think the issue is upon post back it reload the data from view state. We used a webmethod to load stuff to a jquery dialog and do the update via that. And after a successful save updated the grid to reflect the changes.
Upvotes: 0