current cell ''s column mapping name (underlying field name)

How can I get current cell ''s column mapping name (underlying field name) when clicking in a cell? I used this code, but I noticed the column index keep changing when grouping. int iCurrCol=gdBase.TableControl.CurrentCell.ColIndex-1; if (iCurrCol>=0) { string sFieldName=gdBase.TableDescriptor.Columns[iCurrCol].Name; }

2 Replies

AD Administrator Syncfusion Team June 2, 2005 05:47 PM UTC

Try: GridCurrentCell cc = gdBase.TableControl.CurrentCell; GridTableCellStyleInfo style = gdBase.TableControl.Model[cc.RowIndex, cc.ColIndex]; string colName = style.TableCellIdentity.Column.MappingName;


LM Lan Mo June 3, 2005 03:04 PM UTC

It works perfect. Thanks for great help. Lan >Try: > >GridCurrentCell cc = gdBase.TableControl.CurrentCell; >GridTableCellStyleInfo style = gdBase.TableControl.Model[cc.RowIndex, cc.ColIndex]; >string colName = style.TableCellIdentity.Column.MappingName; >

Loader.
Up arrow icon