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. Image for the cookie policy date
close icon

gridgroupingcontrol: Cell Selection depending on being readonly or not

Hi, if you click on a cell in a GridGroupingControl is it possible to not show the blinking cursor in a readonly cell ? Thanks, Oliver

2 Replies

AD Administrator 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; } }


AD Administrator 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; } }

Loader.
Live Chat Icon For mobile
Up arrow icon