Enum class
public class Voltage
{
public int Id{ get; set; }
public string RefNo { get; set; }
public VoltageLevel VoltageLevel { get; set; }
}
public enum VoltageLevel
{
LV = 1,
MV = 2,
HV = 3 }
Controller
public
ActionResult Voltage_Read([DataSourceRequest]DataSourceRequest request)
{
IQueryable<Voltage> voltage= db.Voltage;
DataSourceResult result = voltage.ToDataSourceResult(request, voltage=>
new
{
Id = voltage.Id,
RefNo = voltage.RefNo,
VoltageLevel = voltage.VoltageLevel,
});
return
Json(result);
}
View
@(Html.Kendo().Grid<entities.voltage>()
.Name(
"grid"
)
.Columns(columns =>
{
columns.Bound(c => c.RefNo);
columns.Bound(c => c.VoltageLevel);
//here the voltagelevel didnt show.
})