<div id="flotArea" class="ht-200 ht-sm-300" style="display: contents">
@(Html.EJ().Grid<object>("syncfusionGrid")
.Datasource(Model)
.AllowFiltering((Model != null && Model.Count > 0))
.AllowSorting((Model != null && Model.Count > 0))
.AllowTextWrap()
.SortSettings(sort => sort.SortedColumns(col =>
{
col.Field("Status").Direction(SortOrder.Descending).Add();
col.Field("Relevancia").Direction(SortOrder.Descending).Add();
col.Field("DtEnv").Direction(SortOrder.Descending).Add();
}))
.AllowSelection(false)
.AllowResizeToFit(true)
.AllowPaging().PageSettings(page => { page.PageSize(15); })
.Columns(col =>
{
col.Field("MsgID").IsPrimaryKey(true).Visible(false).Add();
col.Field("Status").Visible(false).Add();
col.Field("Relevancia").Visible(false).Add();
col.Field("StatusTexto").HeaderText("Status").TextAlign(TextAlign.Center).Width(80).Add();
col.Field("Texto").HeaderText("Relevancia").TextAlign(TextAlign.Center).Width(130).Add();
col.Field("Assunto").HeaderText("Assunto").TextAlign(TextAlign.Center).Add();
col.Field("DtEnv").Format("{0:dd/MM/yyyy}").HeaderText("Data de envio").TextAlign(TextAlign.Center).Width(150).Add();
})
)
</div>
Thanks!!!!
@(Html.EJ().Grid<object>("syncfusionGrid")
.Datasource(Model)
.AllowPaging().PageSettings(page => { page.PageSize(15); })
.Columns(col =>
{
col.Field("MsgID").IsPrimaryKey(true).Visible(false).Add();
col.Field("Status").Visible(false).Add();
col.Field("Relevancia").Visible(false).Add();
col.Field("StatusTexto").HeaderText("Status").Template("#columnTemplate").TextAlign(TextAlign.Center).Width(80).Add(); //define the Template property of the column
. . .
})
)
<script type="text/x-jsrender" id="columnTemplate">
<img style="width: 75px; height: 70px" src="../Content/images/Status/{{:Status}}.png" alt="{{:Status}}" /> //Render Image based on Status Column value(Image name with Status column value)
</script> |