@page "/"
<EjsGrid DataSource="@gridData" ModelType="@model" Height="100%" Width="100%" AllowSelection="true" AllowPaging="true">
<GridPageSettings PageSize="2"></GridPageSettings>
<GridColumns>
<Template>
@{
var ch = (context as Channel);
<img src="@ch.Image" />
}
</Template>
</GridColumn>
</GridColumns>
</EjsGrid>
@functions{
public List<Channel> gridData { get; set; }
public Channel model = new Channel();
protected override void OnInit()
{
List<Channel>
order = new List<Channel>
();
order.Add(new Channel { Name = "test1", Group = "Group A", Image = "Not avaible" });
order.Add(new Channel { Name = "test2", Group = "Group B", Image = "https://png.pngtree.com/template/20190529/ourmid/pngtree-logo-chat-tv-image_206663.jpg" });
order.Add(new Channel { Name = "test3", Group = "Group A", Image = "https://upload.wikimedia.org/wikipedia/commons/thumb/e/ed/HD-TV_Logo.svg/800px-HD-TV_Logo.svg.png" });
gridData = order;
}
public class Channel
{
public string Name { get; set; }
public string Group { get; set; }
public string Image { get; set; }
}
}
|
...
<environment include="Development">
<link rel="stylesheet" rel='nofollow' href="css/bootstrap/bootstrap.min.css" />
</environment>
... |