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

checking all CheckBox columns in a grid

1 Answer 40 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Alvaro
Top achievements
Rank 1
Alvaro asked on 14 Sep 2011, 05:00 PM
Hi all,

I have a problem checking all checkbox columns in a grid. I used the next code:

Me.mygrid.GridElement.BeginUpdate()
            For Each row As Telerik.WinControls.UI.GridViewRowInfo In Me.mygrid.Rows
                row.Cells("Checked").Value = True
            Next row 
Me.mygrid.GridElement.EndUpdate()

It works well, but if the grid is sorted by some column the same code is so slow...  

The datatable contains about 15.000 items. is that the problem?

1 Answer, 1 is accepted

Sort by
0
Emanuel Varga
Top achievements
Rank 1
answered on 14 Sep 2011, 07:18 PM
Hello Alvaro,

It will be slow when the grid is sorted... but you can do a few things:
1. remove the sort descriptors before checking all the cells
2. use a binding list, suspend events and programatically set the required values on the underlying data source and then reset the bindings.

Let me know the results, or if you have any other questions please do not hesitate,

Best Regards,
Emanuel Varga
Tags
GridView
Asked by
Alvaro
Top achievements
Rank 1
Answers by
Emanuel Varga
Top achievements
Rank 1
Share this question
or