Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
147491 | Sep 12,2019 11:42 AM UTC | Sep 17,2019 05:13 AM UTC | Blazor | 4 |
![]() |
Tags: Grid |
<EjsGrid @ref="GridInstance" AllowSelection="true" AllowPaging="true" DataSource="@Orders" Height="315">
<GridEvents OnDataBound="DataBoundHandler" TValue="Order"></GridEvents>
<GridSelectionSettings Mode="SelectionMode.Row" Type="SelectionType.Multiple"></GridSelectionSettings> @*By default the selection Mode will be Row*@
...
</EjsGrid>
@code{
...
public async void DataBoundHandler(BeforeDataBoundArgs<Order> args)
{
await Task.Delay(200);
this.GridInstance.GoToPage(2);
this.GridInstance.SelectRow(4);
}
...
}
|
<EjsGrid @ref="GridInstance" ModelType="@Model" AllowSelection="true" AllowPaging="true" DataSource="@Orders">
<GridEvents DataBound="DataBoundHandler" TValue="Order"></GridEvents>
<GridPageSettings PageSize="@PageSize" CurrentPage="@CurrentPage"></GridPageSettings>
. . . .
</EjsGrid>
@code{
public List<Order> Orders { get; set; }
EjsGrid<Order> GridInstance;
public int CurrentPage,RecordIndex,TotalPage;
public int PageSize = 5;
public Order Model = new Order();
protected override void OnInitialized()
{
. . . . ..
RecordIndex = 25 % PageSize;
TotalPage = 25 / PageSize;
CurrentPage = TotalPage + 1;
}
public async void DataBoundHandler()
{
this.GridInstance.SelectRow(RecordIndex);
}
}
|
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.