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.

How to prevent row header text from being deleted?

Thread ID:

Created:

Updated:

Platform:

Replies:

4846 Jun 4,2003 08:10 AM Jun 6,2003 04:24 PM Windows Forms 3
loading
Tags: GridControl
Joy Ni
Asked On June 4, 2003 08:10 AM

I am new to this Grid control. It seems I can highlight a row and hit delete. Then the row header text I just customized will be deleted. How can I prevent this from happenning? User should be able to delete the cell text but not the header text. Thanks.

Administrator [Syncfusion]
Replied On June 4, 2003 09:51 AM

After setting the Header text, also set the cell to be ReadOnly. Me.GridControl1(2, 0).Text = "sample" Me.GridControl1(2, 0).ReadOnly = True

Joy Ni
Replied On June 6, 2003 01:14 PM

I tried this. It still allowed deletion of the header text. > After setting the Header text, also set the cell to be ReadOnly. > > > Me.GridControl1(2, 0).Text = "sample" > Me.GridControl1(2, 0).ReadOnly = True >

Administrator [Syncfusion]
Replied On June 6, 2003 04:24 PM

Setting ReadOnly works in the 1.6 RC1 release which you can download from this link. Read the release notes: http://www.syncfusion.net/squiffler/patches/v1606/readme.htm Download the installation (~59meg): http://www.syncfusion.net/squiffler/patches/v1606/syncfusionessentialsuitesetup.exe In 1.5.2.0, if you want to prevent this you can catch the ClearingCells event, and only clear the non-header cells.
    Private Sub GridControl1_ClearingCells(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridClearingCellsEventArgs) Handles GridControl1.ClearingCells
        If e.RangeList.AnyRangeIntersects(GridRangeInfo.Col(0)) Then
            Dim range, range1 As GridRangeInfo
            For Each range In e.RangeList
                range1 = range.ExpandRange(1, 1, GridControl1.RowCount, GridControl1.ColCount)
                Me.GridControl1.ClearCells(range1, True)
            Next
            e.Handled = 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.

;