我们需要在Syncfusion的WPF网格中保留过滤器(标题行上的那些漏斗过滤)。
如何才能读取当前的过滤器设置以便我们可以保留它?那么以编程方式恢复这些过滤器的方法是什么?
这甚至可能吗?
谢谢, 汤姆
答案 0 :(得分:0)
You can get the Filters for particular column by using the following code snippet.
Code snippet[C#]:
var Filters = this.SyncGrid.VisibleColumns["CustomerID"].Filters;
And also you can add the Filters for particular column by using the following code snippet.
Code Snippet[C#]:
this.SyncGrid.VisibleColumns["CustomerID"].Filters.Add(new Syncfusion.Windows.Data.FilterPredicate()
{
FilterValue = 2,
PredicateType = Syncfusion.Windows.Data.PredicateType.Or,
FilterBehavior = Syncfusion.Linq.FilterBehavior.StringTyped,
FilterType = Syncfusion.Linq.FilterType.Equals
});
Note: Here CustomerID is the MappingName of GridDataVisibleColumn