Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
147723 | Sep 21,2019 04:54 PM UTC | Nov 5,2019 10:07 AM UTC | Blazor | 7 |
![]() |
Tags: Grid |
<EjsGrid DataSource"@OrderData">
<GridColumns>
@for (var I = 0; I < Cols.Length; I++)
{
<GridColumn Field="@Cols[I]" IsPrimaryKey="@(Cols[I] == "OrderID")" HeaderText="@Header[I]"></GridColumn>
}
</GridColumns>
</EjsGrid>
@code{
public string[] Cols = { "OrderID", "CustomerID", "EmployeeID" };
public string[] Header = { "ID", "Name", "Batch ID" }; |
|
<EjsGrid ModelType="@RowValue[0]" DataSource="@RowValue">
<GridColumns>
<GridColumn HeaderText="Names">
<Template>
@{
var index = (context as RowValues)[0];
<span>@index</span>
}
</Template>
</GridColumn>
</GridColumns>
</EjsGrid>
@code{
public class RowValues
{
private List<string> rows = new List<string>() { "VINET" };
public string this[int index]
{
get
{
return rows[index];
}
}
public int ID { get; set; }
}
public List<RowValues> RowValue = new List<RowValues>()
{
new RowValues(){ ID = 1 }
};
} |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.