We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Programmatically selecting and deselecting rows

I am sure this has been asked many times, but I have looked through the docs and KB, but still have not found the answer. How do I programmatically select or deselect a row? For example, if row 2-5 and 8 are selected, but lets say a button somewhere deselects all rows that are a multiple of three, then the result would be 2, 4, 5, and 8 being selected. If it is not trivial, just point me to the place in class reference where I should look and I will figure it out. Thanks

3 Replies

AD Administrator Syncfusion Team May 9, 2005 05:00 PM UTC

Btw, I''m using a virtual grid

AD Administrator Syncfusion Team May 9, 2005 05:15 PM UTC

Here are three methods you can use to manipulate selections: clear all selections - grid.Selections.Clear select/unselect a range - grid.Selections.SelectRange check if a range is selected - grid.Selections.Ranges.AnyRangeContains

AD Administrator Syncfusion Team May 9, 2005 06:05 PM UTC

Clay: Thanks for the direction. I was on the right track with grid.Selections.SelectRange but I did not see the static method GridRangeInfo.Row(rowIndex). For others that come across this, my solution is: this.gridControlNodeList.Selections.SelectRange(GridRangeInfo.Row(e.Index), e.Selected); where e is my eventargs object that contains the rowindex and if the row is selected or not.

Live Chat Icon For mobile
Up arrow icon