2X faster development
The ultimate WinForms UI toolkit to boost your development speed.
Make grid cell as read-onlyTo make a grid cell as read-only, without having the cursor while clicking on the cell, you can cancel the TableControlCurrentCellStartEditing event. In the following code, the cursor is disabled when you click on the RecordFieldCell in the Grid. C# this.gridGroupingControl1.TableControlCurrentCellStartEditing += gridGroupingControl1_TableControlCurrentCellStartEditing; //Disable Record rows being edited and disables blinking cursor inside the cell. void gridGroupingControl1_TableControlCurrentCellStartEditing(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCancelEventArgs e) { GridTableCellStyleInfo style = this.gridGroupingControl1.TableControl.GetTableViewStyleInfo(e.TableControl.CurrentCell.RowIndex, e.TableControl.CurrentCell.ColIndex); if(style.TableCellIdentity.TableCellType==GridTableCellType.RecordFieldCell || style.TableCellIdentity.TableCellType==GridTableCellType.AlternateRecordFieldCell) { e.Inner.Cancel = true; } } VB Private Me.gridGroupingControl1.TableControlCurrentCellStartEditing += AddressOf gridGroupingControl1_TableControlCurrentCellStartEditing 'Disable Record rows being edited and disables blinking cursor inside the cell. Private Sub gridGroupingControl1_TableControlCurrentCellStartEditing(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCancelEventArgs) Dim style As GridTableCellStyleInfo = Me.gridGroupingControl1.TableControl.GetTableViewStyleInfo(e.TableControl.CurrentCell.RowIndex, e.TableControl.CurrentCell.ColIndex) If style.TableCellIdentity.TableCellType=GridTableCellType.RecordFieldCell OrElse style.TableCellIdentity.TableCellType=GridTableCellType.AlternateRecordFieldCell Then e.Inner.Cancel = True End If End Sub
Note: When you are using the browse only property, you can achieve the same behavior but you cannot apply filtering to the grid. Samples: C#: Read-only VB: Read-only |
2X faster development
The ultimate WinForms UI toolkit to boost your development speed.
This page will automatically be redirected to the sign-in page in 10 seconds.