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

Special Cell Selections

Thread ID:

Created:

Updated:

Platform:

Replies:

14506 May 27,2004 01:59 PM May 27,2004 03:22 PM Windows Forms 1
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On May 27, 2004 01:59 PM

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 2.0.5.1, 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 03:22 PM

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

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.

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.

;