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.

Unable to use DataTable with enumeration column type as DataSource.

Thread ID:

Created:

Updated:

Platform:

Replies:

15833 Jun 28,2004 04:47 PM Jun 28,2004 06:06 PM Windows Forms 2
loading
Tags: GridControl
Supriya Thakur
Asked On June 28, 2004 04:47 PM

Syncfusion grid [gridDataBoundGrid] throws an internal exception when the associated DataTable has an enumerated column type. Attached is the sample source code. Please run it with the CLR exceptions turned on in the debugger. An internal exception is thrown in Syncfusion.dll Please let me know how to overcome this issue. We need to use enumerated column types for ease of programming. Thanks and Regards, Supriya

Administrator [Syncfusion]
Replied On June 28, 2004 04:50 PM

Reposting with the attachment: >Syncfusion grid [gridDataBoundGrid] throws an internal exception when the associated DataTable has an enumerated column type. > >Attached is the sample source code. Please run it with the CLR exceptions turned on in the debugger. An internal exception is thrown in Syncfusion.dll > >Please let me know how to overcome this issue. We need to use enumerated column types for ease of programming. > >Thanks and Regards, >Supriya WindowsApplication1_5532.zip

Administrator [Syncfusion]
Replied On June 28, 2004 06:06 PM

You can avoid the exception just by setting the style.CellvalueType to int. this.gridDataBoundGrid1.Binder.InternalColumns["enumtype"].StyleInfo.CellValueType = typeof(int); But this will just display the int value in the grid column as opposed to the name of the enum value. If you want to see the name of the enum value in the column, then you will have to derive the cellmodel, and override the GetFormattedText method, casting the value to the enum there. Here is your sample back with some minimal code. WindowsApplication1_6569.zip

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.

;