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

Adding rows quickly

3 Answers 57 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 1
Bob asked on 27 Jun 2008, 03:15 PM
I want to add 1000 rows to a RadGrid that has 8 columns quickly, and I want the user to see them added real-time.

Currently I'm able to add about 10/second...is that the quickest it can be?

Thanks.

Also, when this is processing (and also later when I update rows) the form itself flickers...suggestions for that as well?

3 Answers, 1 is accepted

Sort by
0
Accepted
Jack
Telerik team
answered on 30 Jun 2008, 11:27 AM
Hello Bob,

Thank you for this question.

You can speed up the process of adding rows by suspending the update operations to be performed on the grid. This approach is illustrated in the code snippet below:

this.radGridView1.GridElement.BeginUpdate(); 
this.radGridView1.Rows.Add(1, "John Smith", 3.45); 
this.radGridView1.Rows.Add(2, "Peter Jackson", 9.12); 
this.radGridView1.Rows.Add(3, "Laura Ashley", 11.11); 
this.radGridView1.GridElement.EndUpdate(); 
 

I hope this helps. Do not hesitate to contact me if you have other questions.

Regards,
Jack
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Bob
Top achievements
Rank 1
answered on 30 Jun 2008, 12:55 PM
Thanks - I was already using this but I realized it was in the wrong place.  I moved it outside of my loop, and that doubled the rate to about 20/second.

Thanks.
0
Jack
Telerik team
answered on 30 Jun 2008, 01:31 PM
Hi Bob,

I am glad to hear you have solved the issue. Please let me know if I can help you further.

Regards,
Jack
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
GridView
Asked by
Bob
Top achievements
Rank 1
Answers by
Jack
Telerik team
Bob
Top achievements
Rank 1
Share this question
or