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.
I have a GGC using a TableControlCurrentCellEditingComplete event to trigger validation. I would like to validate data entered into some of the cells and would like to use the mapping name to determine if the cell needs validation.
I would like to something like:
int n = e.TableControl.TableDescriptor.ColIndexToField(e.Inner.ColIndex);
string colname = e.TableControl.TableDescriptor.Columns[n].MappingName;
if (colname.Equals(...)) get cellvalue ...
However, the e.Inner (GridTableControlEventArgs e) does not contain the ColIndex. Should I use a different event? Also how can I get the edited value from the cell.
Thanks
ADAdministrator 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.
JSJohn 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.