I have a WebGrid that displays a Status enum in one column. There are a couple of enum members that consist of two words and I want to use the enum's DisplayName
property rather than the default ToString()
representation, e.g. "OnHold" should be displayed 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 some way I can get this information using the model metadata?