Filtering not working well

Trying to enable filtering in DataGrids but am running into a number of issues

1) Using the FilterType.Menu values cannot be entered

if I use FilterType.Menu and set the mode to contains the form does not allow me to type in text and always overwrites it with values from the database. also it sill seems to use StartsWith and not Contains


2) Using Contains in GridFilterColumn doesnt work. still uses StartsWith



1 Reply

MS Monisha Saravanan Syncfusion Team March 1, 2022 12:19 PM UTC

Hi Michael, 

Greetings from Syncfusion support. 

Query: “ I use FilterType.Menu and set the mode to contains the form does not allow me to type in text and always overwrites it with values from the database. also it still seems to use StartsWith and not Contains” 
 
We have analyzed your query and we suggest you to set the operator value inside the FilterSettings of the GridColumn. Kindly refer the attached code snippet and UG for your reference. 
 
 
<SfGrid DataSource="@Orders" AllowFiltering="true" AllowPaging="true" Height="315"> 
  <GridFilterSettings Type ="Syncfusion.Blazor.Grids.FilterType.Menu"></GridFilterSettings> 
 
   <GridColumns> 
        <GridColumn Field=@nameof(Order.CustomerID) HeaderText="Customer Name" TextAlign="TextAlign.Center" Width="150" FilterSettings="@(new FilterSettings{ Operator = Operator.Contains })"></GridColumn> 
         
    </GridColumns> 
</SfGrid> 
 
 
Query: “Using Contains in GridFilterColumn doesnt work. still uses StartsWith” 
 
We suspect that you have assigned filter operator inside GridFilterColumn and we would like to inform that this will work only at initial filtering . Instead we suggest you to define the operator inside the FilterSettings. 


If you still face issues then kindly share the below details to validate further at our end. 

  1. Share us the Grid code snippet.
  2. Share us the video demonstration of the issue.
  3. If possible share us the issue reproduceable sample.

Kindly get back to us if you have further queries. 

Regards, 
Monisha 


Loader.
Up arrow icon