Filtering and Case Sensitivity

Good day,

I have a GridGroupingControl that uses a separate textbox as a filter box on a specific column. Any text types into that textbox  will filter the rows according to matching text in a certain column.
Usually in the grids where I implement this the column is all upper case and the textbox is set to change the text to uppercase so I do not have any issues.

However I have run across an issue in one table where the column in question is populated with sentences where both upper and lower case text is present.
In testing this is discovered that the filtering I use is case sensitive.

Considering I use the code below how can i make my filtering case insensitive?
e.g. I have row containing the text "Test data: James"
If I type the text "ja" into the textbox txtFilterSymbol, I'd like the above row to be shown in the filter.


Regards,
James

3 Replies

SN Sindhu Nagarajan Syncfusion Team April 5, 2018 11:17 AM UTC

Hi James, 


Thanks for contacting Syncfusion support. 

We have analyzed your code snippet. In that code part, you have set the FilterCompareOperator as Match. When the condition is set as match, the filtering will be done by  exactly matching the text entered, so it will be Case Sensitive. In order to use the filter as case insensitive, FilterCompareOperator can be set to ExpressionMatch. Please refer to the below code, 
 
Code Snippet 
private void txtFilterSymbol_TextChanged(object sender, EventArgs e) 
{ 
    try 
    { 
        FilterCondition condition = new FilterCondition(FilterCompareOperator.ExpressionMatch, "USA"); 
        RecordFilterDescriptor recordFilterDescriptor = new RecordFilterDescriptor("Country", condition); 
        this.gridGroupingControl1.TableDescriptor.RecordFilters.Add(recordFilterDescriptor); 
    } 
    catch(Exception ex) 
    { 
         
    } 
} 

Please let us know if you have any other queries. 

Regards, 
Sindhu  



JR James Roodt April 5, 2018 11:38 AM UTC

Good day Sindhu,

This is perfect! Thank you very much.

Regards,
James


SN Sindhu Nagarajan Syncfusion Team April 6, 2018 03:58 AM UTC

Hi James, 

Thanks for the update. 

We are glad to hear that the provided solution resolved your scenario. Please let us know if you have any other queries. 

Regards, 
Sindhu  


Loader.
Up arrow icon