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.
ADAdministrator Syncfusion Team 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
JNJoy NiJune 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
ADAdministrator Syncfusion Team 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:
Download the installation (~59meg):
In 22.214.171.124, 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)
e.Handled = True