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

Find DataType of the column in gridGroupingControl

Thread ID:





31412 Jul 7,2005 08:32 AM UTC Jul 7,2005 12:39 PM UTC WinForms 2
Tags: GridControl
Prathima Venkobachar
Asked On July 7, 2005 08:32 AM UTC

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 10:04 AM UTC

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();
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 12:39 PM UTC

Thanks a lot.It works fine. Prathima


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