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

Disabling specific range selection

Thread ID:





11196 Feb 26,2004 12:20 PM UTC Feb 26,2004 03:49 PM UTC WinForms 2
Tags: GridControl
Philip Bishop
Asked On February 26, 2004 12:20 PM UTC

How can i disable a certain range in a grid. For example i want to disable coulum 2 but only row''s 11 to 40 in column 2 if certain criteria is met. I set the clickable and enabled to false and have it set to read only but the user can still drage the mouse over a range and have it highlight. They can also click the ctrl key or shift key to select a range. Can i stop that just for this range so they can do nothing at all to this range?? This is using a non data bound grid and in visual basic. Thanks Phil

Administrator [Syncfusion]
Replied On February 26, 2004 01:59 PM UTC

You can try cancelling the SelectiionChanging event if the range passed in intersects the cells you do not want to select.
Private Sub gridControl1_SelectionChanging(sender As Object, e As GridSelectionChangingEventArgs) handles gridControl1.SelectionChanging
   ''don''t select any cell in row 3
   If e.Range.IntersectsWith(GridRangeInfo.Row(3)) Then
      e.Cancel = True
   End If 
End Sub ''gridControl1_SelectionChanging 

Philip Bishop
Replied On February 26, 2004 03:49 PM UTC

Thanks Clay. I took your code and changed it around to look like the code below and it works fine. If e.Range.IntersectsWith(GridRangeInfo.Col(2)) And e.Range.IntersectsWith(GridRangeInfo.Rows(11, 40)) Then e.Cancel = True End If Thanks again


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