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

Bulk manual loading of rows into grid

1 Answer 119 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mark Nalevanko
Top achievements
Rank 1
Mark Nalevanko asked on 01 Dec 2009, 10:58 PM
Hello,

I have a grid setup with both bound and unbound columns so in order to add new rows to the grid programmatically I'm using the NewRow() and Add() methods on the grid's row collection instead of accessing the underlying datasource. By going this route though, I've noticed it's taking on the order of minutes to fill up 500 rows, which seems really sluggish to me. Am I doing something wrong here? I'm testing with the trial version for download currently.

Private Sub Form1_Load(...)
   Me.RadGridView1.BeginEdit()
   For i as Integer =  1 to 500
       Dim newrow as GridViewRowIndo = Me.RadGridView1.Rows.NewRow()
       ' update a few row cells here....
       Me.RadGridView1.Rows.Add(newrow)
   Next
   Me.RadGridView1.EndEdit()

End Sub

Thanks,
Mark

1 Answer, 1 is accepted

Sort by
0
Julian Benkov
Telerik team
answered on 02 Dec 2009, 02:52 PM
Hi Mark Nalevanko,

This is a known issue in RadGridView. In the next major version of RadGridView we will introduce a new API for the update logic -- BeginUpdate/EndUpdate methods for GridViewTemplate which are to be used to suspend update logic during the data operations such as filtering, sorting, and grouping. UI updates will also be suspended.

Currently, you can add all your rows in the underlying DataSource IList object and then in the Load event handler you can set the DataSource of RadGridView and use your iterator to fill only the unbound data in the rows.

Kind regards,
Julian Benkov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Mark Nalevanko
Top achievements
Rank 1
Answers by
Julian Benkov
Telerik team
Share this question
or