Using JSON as a data source |
Loading...
Razor code
var gridModel = new GridModel(DataSourceType.JSON, "/data/ProductHunt.json");
gridModel.Columns = new List()
{
new GridColumn("Name") {},
new GridColumn("TagLine"),
new GridColumn("Link") {Format = FormatType.Url},
new GridColumn("ImgLink", "Image") {Format = FormatType.Image, RegularExpression = @"^.*?(?=,)"},
new GridColumn("Industry"),
new GridColumn("Votes", "Votes") {DataType = typeof(Int32)},
new GridColumn("PaymentStatus", "Status")
};
gridModel.Cache = true;
@(await new DbNetSuiteCore.GridControl(HttpContext).Render(gridModel))