Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
146980 | Aug 27,2019 02:23 PM UTC | Sep 5,2019 03:38 AM UTC | Blazor | 8 |
![]() |
Tags: Grid |
and gets the data
@{
List<PredicateModel> FilterColumns = new List<PredicateModel>
();
FilterColumns.Add(new PredicateModel() { Field = "CustomerID", MatchCase = false, Operator = "startswith", Predicate = "and", Value = "ANANTR" });
}
<EjsGrid DataSource="@Orders" TValue="Order" AllowPaging="true" AllowFiltering="true">
<EjsDataManager Url="https://services.odata.org/V4/Northwind/Northwind.svc/Orders/" Adaptor="Adaptors.ODataV4Adaptor"></EjsDataManager>
<GridFilterSettings Columns="@FilterColumns"></GridFilterSettings>
………………………………
</EjsGrid> |
i.e. I tried this:
FilterColumns.Add(new PredicateModel() { Field = "Id", MatchCase = true, Operator = "equal", Predicate = "and", Value = "User/Id eq
1acfb089-b4dd-4b4e-8dbc-aab60138c0f7"});
@{
List<PredicateModel> FilterColumns = new List<PredicateModel>();
FilterColumns.Add(new PredicateModel() { Field = "User.Id", MatchCase = false, Operator = "equal", Predicate = "and", Value = "1acfb089-b4dd-4b4e-8dbc-aab60138c0f7" });
}
<EjsGrid ... AllowFiltering="true" ...>
<GridFilterSettings Columns="@FilterColumns"></GridFilterSettings>
<EjsDataManager Url="https://services.odata.org/V4/Northwind/Northwind.svc/Orders/" Adaptor="Adaptors.ODataV4Adaptor"></EjsDataManager>
<GridColumns>
<GridColumn Field="User.Id" HeaderText="ID" Width="90"></GridColumn> @*Define a complex field column in Grid*@
</GridColumns>
</EjsGrid>
|
<EjsGrid ModelType="@Model" DataSource="@Employees" Height="315px">
<GridTemplates>
<DetailTemplate>
@{
var employee = (context as EmployeeData);
<EjsGrid DataSource="@Orders" Toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Cancel", "Update" })" Query="@($"new ej.data.Query().where('EmployeeID', 'equal', {employee.EmployeeID})")">
<GridEditSettings Mode="EditMode.Batch" AllowAdding="true" AllowEditing="true" AllowDeleting="true"></GridEditSettings>
<GridColumns>
<GridColumn Field=@nameof(Order.EmployeeID) DefaultValue="employee.EmployeeID" Width="110"> </GridColumn>
………………………………
</GridColumns>
</EjsGrid>
}
</DetailTemplate>
</GridTemplates>
<GridColumns>
……………………………….
</GridColumns>
</EjsGrid> |
|
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.