Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
150140 | Dec 22,2019 11:19 PM UTC | Dec 24,2019 12:06 PM UTC | Blazor | 3 |
![]() |
Tags: Grid |
<EjsGrid TValue="Order" ID="Grid" AllowPaging="true" Toolbar="@(new List<string>() { "Edit", "Update", "Cancel" })">
<EjsDataManager AdaptorInstance="@typeof(CustomAdaptor)" Adaptor="Adaptors.CustomAdaptor"></EjsDataManager>
<GridEditSettings AllowEditing="true" Mode="@EditMode.Normal"></GridEditSettings>
...
</EjsGrid>
@code{
public static List<Order> Orders { get; set; }
...
// Implementing custom adaptor by extending the DataAdaptor class
public class CustomAdaptor : DataAdaptor
{
// Performs data Read operation to bind Data to Grid at initial loading
public override object Read(DataManagerRequest dm, string key = null)
{
...
return dm.RequiresCounts ? new DataResult() { Result = DataSource, Count = count } : (object)DataSource;
}
// Performs Update operation
public override object Update(DataManager dm, object value, string keyField, string key)
{
//Handle your custom update operation and return the value
return value;
}
}
}
|
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.