Hi Vijay,
Thanks for your patience.
Query #1 "Get all the records where the 'user1' is present in any of the columns like column1 or column2 or column3."
Your requirement can be achieved by adding recordfilters with expertssion. Please refer the below code snippet.
[Codebehind - C#]
void UserFilter_Click(object sender, EventArgs e)
{
this.GridGroupingControl1.TableDescriptor.RecordFilters.Clear();
RecordFilterDescriptor rfd = new RecordFilterDescriptor();
StringBuilder sb = new StringBuilder();
foreach (GridVisibleColumnDescriptor gcd in this.GridGroupingControl1.TableDescriptor.VisibleColumns)
{
sb.AppendFormat("[{0}] like '*{1}*' OR ", gcd.Name, "User1");
}
//'remove last ' OR '
sb.Remove(sb.Length - 4, 4);
rfd.Expression = sb.ToString();
this.GridGroupingControl1.TableDescriptor.RecordFilters.Add(rfd);
this.GridGroupingControl1.DataBind();
}
Query #2 "Get all the records within date range(start date to end date),applying expressions to filters."
Your requiement can be achieved by using logical operator. Please refer the below code snippet.
[Codebehind - C#]
void DateFilter_Click(object sender, EventArgs e)
{
this.GridGroupingControl1.TableDescriptor.RecordFilters.Clear();
GridRecordFilterDescriptor filter2 = new GridRecordFilterDescriptor();
filter2.Name = "Dates";
filter2.LogicalOperator = FilterLogicalOperator.And;
filter2.Conditions.Add(Syncfusion.Grouping.FilterCompareOperator.GreaterThan, "3/24/2005");
filter2.Conditions.Add(Syncfusion.Grouping.FilterCompareOperator.LessThan, "5/10/2005");
this.GridGroupingControl1.TableDescriptor.GridRecordFilters.Add(filter2);
}
For your convenience, we have created sample and the same can be downloaded from the following link.
Custom Filter-1812399385.zipPlease let me know if you have any other questions or concerns.
Regards,
Sridhar.N