AD
Administrator
Syncfusion Team
October 19, 2005 05:40 PM UTC
You can use code like:
GridCurrentCell cc = e.TableControl.CurrentCell;
GridTableCellStyleInfo style = e.TableControl.GetTableViewStyleInfo(cc.RowIndex, cc.ColIndex);
Console.WriteLine(style.TableCellIdentity.Column.MappingName); //column name
Console.WriteLine(cc.Renderer.ControlText); //current value
to get the information you wanted. Not sure what you mean by validate some cells, but TableControlEditingComplete is not a cancelable event. SO, backing out changes may be a problem trying to do cell validation here. Instead, you might trt TableCOntrolCurrentCellValidating to see if that works better for you. You can set e.Inner.Cancel = true to not let the user leave the cell.
JS
John Slater
October 19, 2005 06:01 PM UTC
Thanks for the advice, it''s working perfect.
>You can use code like:
>
>GridCurrentCell cc = e.TableControl.CurrentCell;
>GridTableCellStyleInfo style = e.TableControl.GetTableViewStyleInfo(cc.RowIndex, cc.ColIndex);
>Console.WriteLine(style.TableCellIdentity.Column.MappingName); //column name
>Console.WriteLine(cc.Renderer.ControlText); //current value
>
>
>to get the information you wanted. Not sure what you mean by validate some cells, but TableControlEditingComplete is not a cancelable event. SO, backing out changes may be a problem trying to do cell validation here. Instead, you might trt TableCOntrolCurrentCellValidating to see if that works better for you. You can set e.Inner.Cancel = true to not let the user leave the cell.