Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
147957 | Sep 29,2019 02:05 PM UTC | Oct 7,2019 04:57 AM UTC | Blazor | 3 |
![]() |
Tags: Tabs |
@using Syncfusion.EJ2.Blazor.Navigations
@using Syncfusion.EJ2.Blazor.Grids
<EjsTab>
<TabItems>
<TabItem>
<ChildContent>
<TabHeader Text="Grid"></TabHeader>
</ChildContent>
<ContentTemplate>
<EjsGrid TValue="GridFields" DataSource="@GridData" EnableRtl="true" AllowTextWrap="true">
<GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true"></GridEditSettings>
<GridColumns>
<GridColumn Field=@nameof(GridFields.TrainNo) HeaderText="Train No" IsPrimaryKey="true" Width="120" Type="@ColumnType.Number"></GridColumn>
<GridColumn HeaderText="حذف" Width="20">
<GridCommandColumns>
<GridCommandColumn Type="CommandButtonType.Edit" ButtonOption="@(new CommandButtonOptions() {IconCss="e-icons e-edit", CssClass="e-flat" })"></GridCommandColumn>
<GridCommandColumn Type="CommandButtonType.Delete" ButtonOption="@(new CommandButtonOptions() {IconCss="e-icons e-delete", CssClass="e-flat" })"></GridCommandColumn>
<GridCommandColumn Type="CommandButtonType.Save" ButtonOption="@(new CommandButtonOptions() {IconCss="e-icons e-save", CssClass="e-flat" })"></GridCommandColumn>
<GridCommandColumn Type="CommandButtonType.Cancel" ButtonOption="@(new CommandButtonOptions() {IconCss="e-icons e-cancel", CssClass="e-flat" })"></GridCommandColumn>
</GridCommandColumns>
</GridColumn>
</GridColumns>
</EjsGrid>
</ContentTemplate>
</TabItem>
</TabItems>
</EjsTab>
@code{
public List<GridFields> GridData { get; set; }
protected override void OnInitialized()
{
GridData = Enumerable.Range(1, 5).Select(x => new GridFields()
{
TrainNo = 1000 + x,
Name = (new string[] { "ALFKI", "ANANTR", "ANTON", "BLONP", "BOLID" })[new Random().Next(5)]
}).ToList();
}
public class GridFields
{
public int? TrainNo { get; set; }
public string Name { get; set; }
}
}
|
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.