Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
146116 | Jul 20,2019 09:47 PM UTC | Jul 29,2019 10:04 AM UTC | Blazor | 7 |
![]() |
Tags: Scheduler |
...
<EjsGrid DataSource="@gridData" AllowPaging="true" Toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Cancel", "Update" })">
<GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true" Mode="@EditMode.Normal"></GridEditSettings>
<GridColumns>
<GridColumn Field=@nameof(OrdersDetails.OrderID) HeaderText="Order ID" IsPrimaryKey="true" Width="120"></GridColumn>
...
<GridColumn Field=@nameof(OrdersDetails.ShipCountry) HeaderText="Ship Country" EditType="dropdownedit" Width="150"></GridColumn>
</GridColumns>
</EjsGrid>
@code{
public List<OrdersDetails>
gridData { get; set; }
protected override void OnInit()
{
gridData = OrdersDetails.GetAllRecords();
}
} |
...
<EjsGrid DataSource="@gridData" AllowPaging="true" Toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Cancel", "Update" })" OnActionComplete="@actionCompletedHandler">
<GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true" Mode="@EditMode.Normal"></GridEditSettings>
<GridColumns>
...
</GridColumns>
</EjsGrid>
@functions{
public List<OrdersDetails>
gridData { get; set; }
protected override void OnInit()
{
gridData = OrdersDetails.GetAllRecords();
}
public void actionCompletedHandler(ActionEventArgs args)
{
if(args.RequestType.ToString() == "Save")
{ //you can get edited data by using args.Data
var data = JsonConvert.DeserializeObject<OrdersDetails>(JsonConvert.SerializeObject(args.Data)); //for getting serialized data
// Here you can process your operation to store database
}
}
}
|
|
I do not need a working example (which of course is perfect, if you can provide it). Pseudo code or links to documentation would do.
Thanks again for your really fast response and your good support.I am aware of the fact, that Blazor is a brand new moving target and changing constantly at the moment. You do a really good job !
regards
Uwe
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.