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

Exclude row from selection in GDBG

Thread ID:





14870 Jun 7,2004 04:52 PM UTC Jun 7,2004 05:41 PM UTC WinForms 1
Tags: GridControl
Administrator [Syncfusion]
Asked On June 7, 2004 04:52 PM UTC

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

Administrator [Syncfusion]
Replied On 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.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon