void datagrid_Loaded(object sender, RoutedEventArgs e) { if(this.datagrid.Columns["EmployeeArea"].FilterPredicates.Count >0) { this.Title = this.datagrid.Columns["EmployeeArea"].FilterPredicates[0].FilterValue.ToString(); } } |
void datagrid_FilterChanging(object sender, Syncfusion.UI.Xaml.Grid.GridFilterEventArgs e) e.FilterPredicates.Add(new FilterPredicate() { FilterValue = item.ActualValue, FilterType = FilterType.Equals, FilterBehavior = FilterBehavior.StronglyTyped, IsCaseSensitive = true, PredicateType = PredicateType.And |
We have modified the sample based on this and you can download it from following location,
Sample Location: SfDataGridSample_Filter_Modified.zip
Please let us know if you have any other queries,
Regards,
Saravanan.M
Hi Oleg,
Thanks for your update,
We have analyzed your query. You can achieve your requirement by setting AllowFiltering to Fasle for other columns also you need to set AllowFiltering to True for EmployeeArea column to show the Filter. Please refer the below code snippet.
Code snippet[XAML]:
<Syncfusion:SfDataGrid.Columns> <Syncfusion:GridTextColumn AllowFiltering="False" MappingName="EmployeeName" /> <Syncfusion:GridTextColumn AllowFiltering="False" MappingName="EmployeeAge" /> <Syncfusion:GridTextColumn AllowFiltering="True" MappingName="EmployeeArea" /> <Syncfusion:GridTextColumn AllowFiltering="False" MappingName="EmployeeGender" /> <Syncfusion:GridTextColumn AllowFiltering="False" MappingName="EmployeeSalary" /> <Syncfusion:GridTextColumn AllowFiltering="False" MappingName="Rating" /> </Syncfusion:SfDataGrid.Columns> |
We have modified the sample based on this and you can download it from following location,
Sample Location: SfDataGridSample_Filter_ForColumn.zip
You can also refer the below documentation link to know more about SfDataGrid,
Documentation Link: https://help.syncfusion.com/wpf/welcome-to-syncfusion-essential-wpf
Please refer the below KB link for SfDataGrid,
KB Link: https://www.syncfusion.com/kb/wpf/sfdatagrid
Please let us know if you have any other queries,
Regards,
Saravanan.M
this.datagrid.SerializationController = new SerializationControllerExt(this.datagrid); public class SerializationControllerExt : SerializationController { . . . protected override void RestoreColumnProperties(SerializableGridColumn serializableColumn, GridColumn column) { if (serializableColumn.MappingName != "EmployeeArea") serializableColumn.AllowFiltering = false; base.RestoreColumnProperties(serializableColumn, column); } . . . |