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.
Syncfusion Feedback

How can I access the current record in the ggc and/or in the underlying datatable from TableControlCurrentCellValidating?

Thread ID:

Created:

Updated:

Platform:

Replies:

53450 Dec 13,2006 10:08 PM UTC Dec 18,2006 10:15 AM UTC Windows Forms 5
loading
Tags: Grouping
James Blibo
Asked On December 13, 2006 10:08 PM UTC

Firstly, is this the right event to use when validating cell input and wanting to cancel if validation fails?

How can I access the GridRecord?


How can I access the DataRow of the underlying datatable?

James Blibo
Replied On December 13, 2006 10:40 PM UTC

found it... never mind

James Blibo
Replied On December 13, 2006 10:51 PM UTC

I can not get the DataRowView from the Record in the TableControlCurrentCellValidating.

Record rec = e.TableControl.Table.CurrentRecord;
DataRowView drv = rec.GetData() as DataRowView;

Please help! DataRowView is null!

Administrator [Syncfusion]
Replied On December 14, 2006 06:54 AM UTC

Hi James,

Please refer to the following sample which demonstrates the retrieving of the DataRowView of the currently edited record using your code snippet. Please check whether the editing row is being Record display kind. Which version of the grid are using?

Sample: GGC_CurrentCellValidating.zip

Kindly try it and let us know if you need any further assistance.
Have a nice day.

Best regards,
Madhan

James Blibo
Replied On December 15, 2006 10:44 PM UTC

This is the same code that I posted and said wasn't working. DataRowView is always null.

I have a flat datasource that is grouped by one column. The version of the grid is 4.4

Administrator [Syncfusion]
Replied On December 18, 2006 10:15 AM UTC

Hi James,

Thank you for being patience.

We tried using your code snippet to reproduce the issue here. The reason for the DataRowView being null is because the resultant of the rec.GetData() method is DataRow. Please try using the following code snippet to retrieve the data.

>>>>>>>>>>>>
// TableControlCurrentCellValidating event
Record rec = e.TableControl.Table.CurrentRecord;
DataRow dr = rec.GetData() as DataRow;
Console.WriteLine(dr[0]);
>>>>>>>>>>>>

Kindly let us know if you need any further assistance.

Best regards,
Madhan

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

;