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.
Unfortunately, activation email could not send to your email. Please try again.

GGC Mapping name and value of current cell

Thread ID:

Created:

Updated:

Platform:

Replies:

36078 Oct 19,2005 12:32 PM Oct 19,2005 02:01 PM Windows Forms 2
loading
Tags: Grouping
John Slater
Asked On October 19, 2005 12:32 PM

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 01:40 PM

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 02:01 PM

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.

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.

;