Hi Rohit,
Thank you for your patience.
There are two options available to perform the case insensitive filter.
Option 1:
You need to include vertical bar inside the comparevalue argument of filter.Conditions.Add method, to perform Case Insensitive filter. Here Vertical bar specifies alternative. (ie., either capital or small letter). Suppose if you want to perform case insentive filter for a string "babu", then you need to specify the comparevalue as "(B|b)(A|a)(B|b)(U|u)".Please refer the below code for more details.
RecordFilterDescriptor filter = new RecordFilterDescriptor();
filter.Name = "Name";
filter.LogicalOperator = FilterLogicalOperator.Or;
filter.Conditions.Add(FilterCompareOperator.Match, @"(B|b)(A|a)(B|b)(U|u)");
this.gridGroupingControl1.TableDescriptor.RecordFilters.Add(filter);
Option 2:
You need to call QueryRecordMeetsFilterCriteria event inside the button click event where the filter is applied, to perform the case insensitive filter. Here Case Insensitive comparision is performed inside the QueryRecordMeetsFilterCriteria event. If condition is satisfied then you need to set e.Result as true, otherwise you need to set the e.Result as false. Please refer the below code snippet for more details.
void gridGroupingControl1_QueryRecordMeetsFilterCriteria(object sender, QueryRecordMeetsFilterCriteriaEventArgs e)
{
Object obj = e.Record.GetValue("Name");
if (obj.ToString().ToLower() == "babu")
{
e.Result = true;
Console.WriteLine("Rec:"+obj.ToString());
}
else
{
e.Result = false;
}
e.Handled = true;
}
private void buttonAdv1_Click(object sender, EventArgs e)
{
RecordFilterDescriptor filter = new RecordFilterDescriptor();
filter.Name = "Name";
filter.LogicalOperator = FilterLogicalOperator.Or;
filter.Conditions.Add(FilterCompareOperator.Match, @"babu");
this.gridGroupingControl1.TableDescriptor.RecordFilters.Add(filter);
this.gridGroupingControl1.QueryRecordMeetsFilterCriteria += new QueryRecordMeetsFilterCriteriaEventHandler(gridGroupingControl1_QueryRecordMeetsFilterCriteria);
}
QueryRecordMeetsFilterCriteria - Occurs when a record is checked whether it meets filter criteria and should appear visible in the table's DisplayElements.
Here is the minimal sample which implements this task.
http://websamples.syncfusion.com/samples/grid.windows/F73663/main.htmPlease let me know if this helps.
Best Regards,
Srirajan