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

How can a get the datatype of the active column?

Thread ID:





7203 Sep 16,2003 08:53 AM UTC Sep 17,2003 03:29 AM UTC WinForms 2
Tags: GridControl
Richard Kettelerij
Asked On September 16, 2003 08:53 AM UTC

I use a GridDataBoundGrid and i'm trying to get the datatype of the active column (the column with the selected cell). How can i do that? I used the code below, but it doesn't seem to work because it always returns System.Int32 (while most columns contain text information). Console.WriteLine(_grid.CurrentCell.GetType()); or _grid.GetCol(_grid.CurrentCell.ColIndex).GetType(); Thanks in advance.

Administrator [Syncfusion]
Replied On September 16, 2003 09:16 AM UTC

If you have not explicitly added GridBoundColumns, then you could use code like: int field = _grid.Binder.ColIndexToField(_grid.CurrentCell.ColIndex); Type t = _grid.Binder.InternalColumns[field].StyleInfo.CellValueType; If you have added GridBoundColumns, then you would use _grid.GridBoundColumns instead of _grid.Binder.InternalColumns.

Richard Kettelerij
Replied On September 17, 2003 03:29 AM UTC

It didn't exactly did the trick, but thanks anyway


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