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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Vinz : How to travels through every cell of a AddNewRecordRow and capture the data ?

Thread ID:





22635 Dec 17,2004 12:16 AM UTC Feb 6,2020 06:21 AM UTC WinForms 1
Tags: GridControl
Vincent Loy Chee Hoon
Asked On December 17, 2004 12:16 AM UTC

Hi, I''m hard time figuring out how to travels through every cell of the AddNewRecordRow of a GridGroupingControl using this ----> ''e'' parameter ( Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCancelEventArgs) contain within the TableControlCurrentCellValidating event The purpose of travels through every of these cells is to check whether all these cells contain empty data. I would really appreciate if anyone can advise me a method which can help me to get this done.thanks :) Best Regards Vincent

Administrator [Syncfusion]
Replied On December 17, 2004 09:05 AM UTC

Here is some code to try. There are 2 cases to consider. One, the cell that was just changed and two, the other cells in the row.
private void gridGroupingControl1_TableControlCurrentCellValidating(object sender, GridTableControlCancelEventArgs e)
	GridCurrentCell cc = e.TableControl.CurrentCell;
	GridTableCellStyleInfo style = e.TableControl.Model[cc.RowIndex, cc.ColIndex] as GridTableCellStyleInfo;
	if(style.TableCellIdentity.TableCellType == GridTableCellType.AddNewRecordFieldCell)
		//on a new record
		GridRecordRow newRec = style.TableCellIdentity.DisplayElement as GridRecordRow;
		foreach(GridColumnDescriptor cd in style.TableCellIdentity.Table.TableDescriptor.Columns)
			if(cd.MappingName == style.TableCellIdentity.Column.MappingName)
			{//active cell				Console.WriteLine("{0}=''{1}''", cd.MappingName, cc.Renderer.ControlText);
			if (newRec.GetData() != null)
			{//other cells

				DataRowView drv = newRec.GetData() as DataRowView;
				if(drv != null)
					Console.WriteLine("{0}=''{1}''", cd.MappingName, drv[cd.MappingName]);
					Console.WriteLine("{0}=''null''", cd.MappingName);
		Console.WriteLine(" ");


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon