I have a WebGrid that displays an enumeration of state in a single column. There are several members of an enumeration that consist of two words, and I want to use the enum property DisplayNamerather than the default view ToString(), for example. "OnHold" should display as "On Hold."
@grid.GetHtml(
tableStyle: "webGrid",
headerStyle: "header",
alternatingRowStyle: "alt",
mode: WebGridPagerModes.All,
columns: grid.Columns(
grid.Column("JobId", "Job ID"),
grid.Column("Status", "Status", item =>
{
return ModelMetadata
.FromLambdaExpression(**What goes in here**)
.DisplayName;
}),
grid.Column("OutageType", "Outage Type"),
Is there any way to get this information using model metadata?
source
share