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.
Unfortunately, activation email could not send to your email. Please try again.

Programmatically selecting and deselecting rows

Thread ID:





28728 May 9,2005 01:00 PM May 9,2005 02:05 PM Windows Forms 3
Tags: GridControl
Administrator [Syncfusion]
Asked On May 9, 2005 01:00 PM

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

Administrator [Syncfusion]
Replied On May 9, 2005 01:00 PM

Btw, I''m using a virtual grid

Administrator [Syncfusion]
Replied On May 9, 2005 01:15 PM

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

Administrator [Syncfusion]
Replied On May 9, 2005 02:05 PM

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.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.