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
close icon

Exclude row from selection in GDBG

Is there a way to set a row in a state that it can''t be selected in the GDBG? I have some DataRows in the datasource which have a logical state and they should not be selectable in the grid. By default, the ListBoxSelectionMode is set to One, it should also work when it is set to MultiExtended. Which events have to be used to achive this? 1. the row cannot be selected, also when MultiExtended is set 2. The row is visual marked(PrepareViewStyleInfo(?) to changing text color) Regards Thomas

1 Reply

AD Administrator Syncfusion Team June 7, 2004 05:41 PM UTC

To avoid a row, say someRowIndex, being included in a selection, you can handle the grid.Model.SelectionsChanging event. If e.Range.IntersectsWith(GridRangeInfo.Row(someRowIndex)), then you can set e.Cancel to prevent the selection. To color such a row, you would use grid.PrepareViewStyleInfo, setting e.Style.BackColor if e.RowIndex equals someRowIndex.

Loader.
Live Chat Icon For mobile
Up arrow icon