Take attention to the
public enum SomeList
{
EmptyItem = 0,
ListItem0,
ListItem1,
ListItem2,
ListItem3,
}
type.
DynamicallyAutoDetectDataTypeColumn columns use System.Reflection to extract TypeEditor and TypeConverter of data type displayed to provide convenient way for editing.
You can provide list of aaa,bbb,ccc by using
public enum ListOfStrings
{
aaa,
bbb,
ccc
}
enum to provide this data with dropdown list.
If you'll provide:
[Flags]
[Editor(typeof(NineRays.Windows.Forms.Design.FlagsEnumEditor), typeof(System.Drawing.Design.UITypeEditor))]
public enum ListOfStrings
{
empty = 0, //empty value
aaa = 1,
bbb = 2,
ccc = 4
}
and replace
dataSetList.Add( new object[] { rawList } );
by
dataSetList.Add( new object[] { ListOfStrings.aaa } );
DynamicallyAutoDetectDataTypeColumn will shows dropdownlist wth checkboxes as NineRays.Windows.Forms.Design.FlagsEnumEditor provide this editor.
Please read MSDN about TypeConverterAttribute, Typeconverter, TypeEditor to expand DynamicallyAutoDetectDataTypeColumn editing functionality with universal data type editors and converters that will work in standard PropertyGrid and FlyGrid.Net.
By this way you can provide dynamic list values in dropdown.
Additionally - see the VerticalGrid sample to see how FlyGrid and DynamicallyAutoDetectDataTypeColumn use power of System.Reflection and System.Design at runtime.