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

How to set FieldType as ENUM?

I have set the datasouce, and one columntype is enum, but it doesn't work? How to resolve it?

2 Replies

YA yanghao February 17, 2016 11:43 PM UTC

I have set the datatable columntype as enum as follows:

private DataTable dtTitle = new DataTable();
gridTitle.DataSource = dtTitle;      
dtTitle.Columns.Add("Visible", typeof(bool));    
dtTitle.Columns.Add("Position", typeof(Position));   //Position is ENUM
dtTitle.Columns.Add("Content", typeof(string));       
dtTitle.Columns.Add("Color", typeof(Color));           
dtTitle.Columns.Add("Font", typeof(Font));      
dtTitle.Columns.Add("Margin", typeof(Padding));   

#region Control Position
[TypeConverter(typeof(ExpandableObjectConverter))]               
public enum Position : byte 
{
Top = 0,
Bottom = 1,
Left = 2,
Right = 3
}

But the GGC shows as attachfile, how to set it? Thank you!


Attachment: GGC_3a38e60f.rar


PK Pavithra Kodiyarasan Syncfusion Team February 18, 2016 10:55 AM UTC

Hi Yanghao,

Thanks for contacting syncfusion support.

By analyzing your given image and problem we thought that you set PropertyGrid to all columns DropDown cells. That’s why the enum columntype was not working. Please refer the following sample.

Sample:
http://www.syncfusion.com/downloads/support/forum/122099/ze/WindowsFormsApplication1193865938


If your requirement is different from this, Please let us know with clear explanation.

Regards,
Pavithra K.

Loader.
Up arrow icon