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

Unable to use DataTable with enumeration column type as DataSource.

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

2 Replies

AD Administrator Syncfusion Team 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


AD Administrator Syncfusion Team 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

Loader.
Live Chat Icon For mobile
Up arrow icon