This is a migrated thread and some comments may be shown as answers.

Gridview Update

3 Answers 157 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Joe Bohen
Top achievements
Rank 1
Joe Bohen asked on 05 May 2009, 09:34 PM

I have an unbound gridview and the data behind is update constantly.  What is considered to be the best method to update data in the gridview? Which will have least impact on performance?

3 Answers, 1 is accepted

Sort by
0
Nick
Telerik team
answered on 06 May 2009, 07:22 AM
Hi Joe Bohen,

There is a very good external article here about simple ways to speed up RadGridView. The concrete answer to your question is use BeginUpdate, EndUpdate functions to add/remove rows in chunks.

Kind regards,
Nick
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Joe Bohen
Top achievements
Rank 1
answered on 10 May 2009, 07:16 AM

Hi Nick

Sorry it has taken me some time to respond to your post, I have taken a look at the site but it does not really help me. I will try to explain my requirements a little more clearly. I am currently using an ms listview to display a maximum of 150 records in 17 columns I am using a disconnected data source to populate the listview at runtime. The records in the sql table are constantly updated from other sources; I use a background worker to check for changes in the data by loading the current values from the listview into a public array and then the background worker is called from a timer and loads the current sql data into a dataset and checks the array values against the dataset for changes  if any are found another array is populate with updated records and when the background workers complete event fires the updated records are loaded onto the listview. I am sure there must be a cleaner method to achieve this!  I want to replace the listview with a radgrid control should I continue to use the existing method to update the radgrid or would you suggest another method.?

Regards
Joe

0
Nick
Telerik team
answered on 11 May 2009, 09:33 AM
Hi Joe Bohen,

Thank you for the detailed description. First I will try to summarize your scenario -- you need to present data using a disconnected model and constantly check the data base for updates so that you can update your local data. I will answer your question from UI standpoint which is in our support scope. The simplest way to implement your scenario is to use a data table which is the data source for your grid. There are two options - retrieve all the data every time you check for updates or use some code to update only the rows that have been changed. Using the former form UI standpoint means that the grid will be refreshed entirely which brings slow performance in UI layer. Using the latter means that the grid will update only the rows that are changed and visible which means better performance in the UI layer. Please note that I am not considering your code in the UI layer. 

I hope that this answers your question. Do not hesitate to write me back if you have further questions.

All the best,
Nick
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
GridView
Asked by
Joe Bohen
Top achievements
Rank 1
Answers by
Nick
Telerik team
Joe Bohen
Top achievements
Rank 1
Share this question
or