Hi,
I was wondering what is the easiest way to bind the Enum data to DropDownList in DataGrid?
Grid:
<e-grid-column field="Status" headerText="Status" editType="dropdownedit" width="120"> </e-grid-column>
Enum model:
public enum Status
{
[EnumMember(Value = "Delivery")]
Delivery = 0,
[EnumMember(Value = "Warehouse")]
Warehouse = 1,
[EnumMember(Value = "Drying")]
Drying = 2,
[EnumMember(Value = "Dried")]
Dried = 3,
[EnumMember(Value = "Cutting")]
Cutting = 4,
[EnumMember(Value = "Cutted")]
Cutted = 5
}
|
public class OrdersDetails
{
public int? OrderID { get; set; }
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
public state State { get; }
}
public enum state
{
[EnumMember(Value = "Delivery")]
Delivery = 0,
[EnumMember(Value = "Warehouse")]
Warehouse = 1,
[EnumMember(Value = "Drying")]
Drying = 2,
[EnumMember(Value = "Dried")]
Dried = 3,
[EnumMember(Value = "Cutting")]
Cutting = 4,
[EnumMember(Value = "Cutted")]
Cutted = 5
}
|
Hi Rajapandiyan,
tnx for the example, however this example only works if the table is already populated. If the table is not populated the example does not work.
Populated table:
Unpopulated table:
Because only two records exist in the table it returns only two options. But I want to return the list where you could select from all options.
I guess I need to bind the data using URL adaptor?
Thank you for your support, Miha