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.

Find DataType of the column in gridGroupingControl

Thread ID:

Created:

Updated:

Platform:

Replies:

31412 Jul 7,2005 04:32 AM Jul 7,2005 08:39 AM Windows Forms 2
loading
Tags: GridControl
Prathima Venkobachar
Asked On July 7, 2005 04:32 AM

Hi, On GridGroupingControl.TableControlCurrentCellKeyPress event I want to know the dataype of the column in a gridGroupingControl. can we know the datatype of the column..? If so, how can i loop through all the records and all the columns in the grid..? To loop through all the records I am using foreach (GridRecord rec in this.gridGroupingControl.SyncfusionGridControl.Table.Records) { } How can I loop through all the columns and find out each column datatype dynamically ..? Thanks, Prathima

Administrator [Syncfusion]
Replied On July 7, 2005 06:04 AM

In the current cell key press event, I think this code will get the type of the column:
GridCurrentCell cc = e.TableControl.CurrentCell;
GridTableCellStyleInfo style = e.TableControl.Model[cc.RowIndex, cc.ColIndex];
if(style.TableCellIdentity.Column != null)
{
	Type t = style.TableCellIdentity.Column.FieldDescriptor.GetPropertyType();
	Console.WriteLine(t);
}
If you want to loop through all columns, you can loop through the grid.TableDescriptor.Columns collection using the column.FieldDescriptor.GetPropertyType() to get teh type of each column.

Prathima Venkobachar
Replied On July 7, 2005 08:39 AM

Thanks a lot.It works fine. Prathima

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.

;