The Syncfusion® native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
ADAdministrator Syncfusion Team March 17, 2005 02:21 PM UTC
If it is a readonly textbox cell, in addition to setting StyleInfo.ReadOnly = true, also set StyleInfo.CellType = "Static".
If it is not a textbox, then you can try handling the TableControlCurrentCellStartEditing. So, if you have set something like,
this.gridGroupingControl1.TableDescriptor.Columns["region"].Appearance.AnyRecordFieldCell.ReadOnly = true;
to make the cell readonly, you can use this handler to prevent teh edit cursor from showing.
private void gridGroupingControl1_TableControlCurrentCellStartEditing(object sender, GridTableControlCancelEventArgs e)
{
GridCurrentCell cc = e.TableControl.CurrentCell;
int field = e.TableControl.TableDescriptor.ColIndexToField(cc.ColIndex);
GridTableCellStyleInfo style = e.TableControl.TableDescriptor.Columns[field].Appearance.AnyRecordFieldCell;
if(style.ReadOnly)
{
e.Inner.Cancel = true;
}
}
ADAdministrator Syncfusion Team March 18, 2005 03:53 PM UTC
Hi,
i found another way. Haven''t set the Tabledescriptor. The following worked for me :
private void m_syncGrid_TableControlCurrentCellStartEditing(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCancelEventArgs e)
{
Syncfusion.Windows.Forms.Grid.GridCurrentCell cc = e.TableControl.CurrentCell;
int field = e.TableControl.TableDescriptor.ColIndexToField(cc.ColIndex);
Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor style = e.TableControl.TableDescriptor.Columns[field];
if(style.ReadOnly)
{
e.Inner.Cancel = true;
}
}