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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Disabling specific range selection

Thread ID:

Created:

Updated:

Platform:

Replies:

11196 Feb 26,2004 12:20 PM UTC Feb 26,2004 03:49 PM UTC WinForms 2
loading
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

CONFIRMATION

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.

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

;