We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Grid selection doesn't work with remote data and search of a specific column

Hi SyncFusion,

I am build a blazor app using a grid. To simplify my problem I have reduced my problem to different examples you provide.

The selection of a grid row and/or cell doesn't work together with Remote data and search specific column.

For my simplified example I have used:

- https://ej2.syncfusion.com/blazor/documentation/grid/data-binding/#binding-with-odata-v4-services
- https://ej2.syncfusion.com/blazor/documentation/grid/searching/#search-specific-columns
- https://ej2.syncfusion.com/blazor/documentation/grid/selection/

My example, which doesn't work:

@using Syncfusion.EJ2.Blazor.Data
@using Syncfusion.EJ2.Blazor.Grids

         AllowSelection="true" Toolbar="@(new List() { "Search" })">
   
   
   
       
       
       
       
       
   

@code {
    public List Orders { get; set; }

    protected override void OnInitialized()
    {
        Orders = Enumerable.Range(1, 75).Select(x => new Order()
        {
            OrderID = 1000 + x,
            CustomerID = (new string[] { "ALFKI", "ANANTR", "ANTON", "BLONP", "BOLID" })[new Random().Next(5)],
            Freight = 2.1 * x,
            OrderDate = DateTime.Now.AddDays(-x),
        }).ToList();
    }

    public Order GridOrderModel { get; set; }

    public class Order
    {
        public int? OrderID { get; set; }
        public string CustomerID { get; set; }
        public DateTime? OrderDate { get; set; }
        public double? Freight { get; set; }
    }
}

Update: I am using .NET Core 3.1 Blazor Server and Syncfusion.EJ2.Blazor Version 17.3.0.29-beta

Thank you very much!

Kind regards
Pascal


5 Replies

PB Pascal Botzke December 17, 2019 03:43 PM UTC

Hi SyncFusion,

I am build a blazor app using a grid. To simplify my problem I have reduced my problem to different examples you provide.

The selection of a grid row and/or cell doesn't work together with Remote data and search specific column.

For my simplified example I have used:

- https://ej2.syncfusion.com/blazor/documentation/grid/data-binding/#binding-with-odata-v4-services
- https://ej2.syncfusion.com/blazor/documentation/grid/searching/#search-specific-columns
- https://ej2.syncfusion.com/blazor/documentation/grid/selection/

My example, which doesn't work:

@using Syncfusion.EJ2.Blazor.Data
@using Syncfusion.EJ2.Blazor.Grids

<EjsGrid TValue="Order" ModelType="@GridOrder" AllowPaging="true" Height="300" Width="650"
         AllowSelection="true" Toolbar="@(new List<string>() { "Search" })">
    <EjsDataManager Url="https://services.odata.org/V4/Northwind/Northwind.svc/Orders/" Adaptor="Adaptors.ODataV4Adaptor"></EjsDataManager>
    <GridSearchSettings Fields="@(new string[] { "OrderID", "CustomerId" })"></GridSearchSettings>
    <GridColumns>
        <GridColumn Type="ColumnType.CheckBox" Width="50"></GridColumn>
        <GridColumn Field=@nameof(Order.OrderID) HeaderText="Order ID" TextAlign="TextAlign.Right" Width="120"></GridColumn>
        <GridColumn Field=@nameof(Order.CustomerID) HeaderText="Customer Name" Width="150"></GridColumn>
        <GridColumn Field=@nameof(Order.OrderDate) HeaderText=" Order Date" Format="yMd" Type="ColumnType.Date" TextAlign="TextAlign.Right" Width="130"></GridColumn>
        <GridColumn Field=@nameof(Order.Freight) HeaderText="Freight" Format="C2" TextAlign="TextAlign.Right" Width="120"></GridColumn>
    </GridColumns>
</EjsGrid>

@code {
    public List Orders { get; set; }

    protected override void OnInitialized()
    {
        Orders = Enumerable.Range(1, 75).Select(x => new Order()
        {
            OrderID = 1000 + x,
            CustomerID = (new string[] { "ALFKI", "ANANTR", "ANTON", "BLONP", "BOLID" })[new Random().Next(5)],
            Freight = 2.1 * x,
            OrderDate = DateTime.Now.AddDays(-x),
        }).ToList();
    }

    public Order GridOrderModel { get; set; }

    public class Order
    {
        public int? OrderID { get; set; }
        public string CustomerID { get; set; }
        public DateTime? OrderDate { get; set; }
        public double? Freight { get; set; }
    }
}

Update: I am using .NET Core 3.1 Blazor Server and Syncfusion.EJ2.Blazor Version 17.3.0.29-beta

Thank you very much
Kind regards
Pascal

PS: There was a display error to my example code


PB Pascal Botzke December 18, 2019 10:41 AM UTC

Hi SyncFusion,

I found the new Version 17.4.0.39 this morning. My Problem seems to be solved with this version.

But my licence doesn't work any more. We contact you via email for this problem.

Kind Regards
Pascal


RS Renjith Singh Rajendran Syncfusion Team December 18, 2019 01:54 PM UTC

Hi Pascal, 

Thanks for contacting Syncfusion support. 

Query : But my licence doesn't work any more. We contact you via email for this problem. 
We suggest you to refer to the below KB to resolve this problem. 

Please get back to us if you need further assistance. 

Regards, 
Renjith Singh Rajendran. 



PB Pascal Botzke December 18, 2019 02:31 PM UTC

Hi Renjith Singh Rajendran,

thank you for the KB Link. With this I was able to solve the licence problem.

Regards,
Pascal Botzke


VN Vignesh Natarajan Syncfusion Team December 19, 2019 03:39 AM UTC

Hi Pascal,  

Thanks for the update.  

We ae glad to hear that you have resolved your query using our solution.  

Please get back to us if you have further queries.  

Regards, 
Vignesh Natarajan. 


Loader.
Live Chat Icon For mobile
Up arrow icon