checking all CheckBox columns in a grid

2 posts, 0 answers
  1. Alvaro
    Alvaro avatar
    1 posts
    Member since:
    Sep 2011

    Posted 14 Sep 2011 Link to this post

    Hi all,

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

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

    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?
  2. Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 14 Sep 2011 Link to this post

    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
Back to Top