I am adding a filter option to my XamDataGrid and I was wondering if there is anyway to restyle either the regular textblock filter or the excel dialog filter. For the textblock filter is there a way to update the operators (Equals, Begins with, etc.) by removing the ones we don't want? Also is it possible to change the icons for some of the options. I don't think I have access to the default XamDataGrid styles so I can't update the default templates for those controls.
Hello Jakub,
Thank you for your support request.
You find the default style for XamDataGrid from the following location on your machine: C:\Program Files (x86)\Infragistics\2015.2\WPF\DefaultStyles\DataPresenter. The style for FilterCellValuePresenter is located in file with name “DataPresenterGeneric_Express.xaml”, so you would be able to copy and modify it in order to change the visual appearance of filter cells.. You can take a look at the following forum thread where Andrew has provided an example of how to change the style of filter operators and modify the icons:
http://www.infragistics.com/community/forums/t/89580.aspx
About the requirement for updating the operators(Equals, Starts With, … ). They are resource strings, so you can easily modify the value that is display to the end user. You can find more details from the following forum thread:
http://www.infragistics.com/community/forums/t/38554.aspx
for example you can use the SetCustomizedString method:
Infragistics.Windows.Resources.Customizer.SetCustomizedString("ComparisonOperator_Equals", "Custom Equals");
If you would like to hide some item, you can create style for ComboBoxItem in order to handle it’s Loaded event and set the Visibility property depending on it’s value:
<Style TargetType="{x:Type ComboBoxItem}"> <EventSetter Event="Loaded" Handler="operators_Loaded"/></Style>
private void operators_Loaded(object sender, RoutedEventArgs e) { if ((sender as ComboBoxItem).Content.ToString() == "Starts with") (sender as ComboBoxItem).Visibility = Visibility.Collapsed; }
I have attached simple project that illustrates this approache, please take a look and let me know if you require any further assistance regarding this matter.
So i was able to find the style files and modify various styles for the filtering stuff. I was wondering if it would be possible to restyle Excel filter popup when I use FilterLabelIconDropDownType="MultiSelectExcelStyle". I was able to modify RecordFilterTreeControl to change the inner tree but the outer popup window wasn't affected.