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. (Last updated on : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GGC Mapping name and value of current cell

Thread ID:

Created:

Updated:

Platform:

Replies:

36078 Oct 19,2005 04:32 PM UTC Oct 19,2005 06:01 PM UTC WinForms 2
loading
Tags: Grouping
John Slater
Asked On October 19, 2005 04:32 PM UTC

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

Administrator [Syncfusion]
Replied On 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.

John Slater
Replied On 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.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;