Exception in GetFilteredRecords with large database

Hello,
I have a problem to get all filtered records for a Grid. The function GetFilteredRecords throws the following exception if there are big number of filtered records:
"Response status code does not indicate success: 500 (Internal Server Error)."

I added MaximumReceiveMessageSize = 204800000 but any number might be not enough in certain situations.

I could retrieve database records using my own code, but then I would need an info about the filter set by user. For example like a set of fields passed to the controller as HttpRequest.Query. Would be possible to obtain it from the grid?


3 Replies 1 reply marked as answer

VN Vignesh Natarajan Syncfusion Team March 30, 2021 04:04 AM UTC

Hi Andrzej,  
 
Thanks for contacting Syncfusion support.  
 
Query: “but then I would need an info about the filter set by user. For example like a set of fields passed to the controller as HttpRequest.Query. Would be possible to obtain it from the grid? 
 
Yes, we suggest you to achieve your requirement using FilterSettings property of Grid. Refer the below code example and screenshot for your reference 
 
<SfButton Content="Get Filter Settings" OnClick="Filter"></SfButton> 
  
<SfGrid @ref="Grid" DataSource="@Orders" AllowFiltering="true" AllowPaging="true"> 
    <GridColumns> 
        <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="d" 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> 
</SfGrid> 
  
@code{ 
    SfGrid<Order> Grid { getset; } 
    public void Filter() 
    {         
        //get the filter column ndetails using FilterSettings property 
        var FilterSettings = Grid.FilterSettings; 
    } 
 
 
 
 
Note: We have applied filter to two columns.  
 
Refer our API documentation for your reference 
 
 
Please get back to us if you have further queries.  
 
Regards, 
Vignesh Natarajan  


Marked as answer

AN Andrzej March 30, 2021 07:44 AM UTC

Thanks, it works. I see that I can also get SortSettings and create a complete query to get records in chunks.
Best regards



VN Vignesh Natarajan Syncfusion Team March 30, 2021 11:19 AM UTC

Hi Andrzej, 

Thanks for the update. 

We are glad to hear that you have achieved your requirement using our solution.  

Please get back to us if you have further queries.  

Regards, 
Vignesh Natarajan 


Loader.
Up arrow icon