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

Special Cell Selections

Thread ID:





14506 May 27,2004 05:59 PM UTC May 27,2004 07:22 PM UTC WinForms 1
Tags: GridControl
Administrator [Syncfusion]
Asked On May 27, 2004 05:59 PM UTC

I need a way to keep the grayed cells (see attached sample) from being selected. I have some code commented out in the selection changing event that almost works but I want the first 32 cells in column 1 & column 2 to be selected when the user clicks the column header. If possible I would like to be able to use the mouse or arrow keys and select all the cells except the grayed ones. Please note I''m using an, Essential Grid version, GridControl with Visual Basic.Net not a DataBoundGrid with C code. Please note the difference when sending me samples. Thank you, John SpecialCellSelectionChanging_4598.zip

Administrator [Syncfusion]
Replied On May 27, 2004 07:22 PM UTC

Try this code.
  Private Sub grdCreditPDS_SelectionChanging(ByVal sender As System.Object, ByVal e As GridSelectionChangingEventArgs)

        If (e.Range.Contains(GridRangeInfo.Col(1)) Or e.Range.Contains(GridRangeInfo.Col(2))) Then
            e.Range = GridRangeInfo.Cells(1, e.Range.Left, 32, e.Range.Right)
        End If

        If (e.Range.IntersectsWith(GridRangeInfo.Cells(33, 1, 128, 2))) Then
            e.Cancel = True
        End If

    End Sub


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