There are two XamComboEditor controls in the library. One in the Infragistics.Controls.Editors and another in Infragistics.Windows.Editors.
I am having to use the Infragistics.Controls.Editors.XamComboEditor because it allows autocomplete/filtering on conditional operator (example below)
<ig:XamComboEditor AllowFiltering="True" AutoComplete="True" ItemsSource="{Binding BookCodes}" SelectedItem="{Binding SelectedBook}"> <ig:XamComboEditor.ItemFilters> <ig:ComboItemFilter> <ig:ComboItemFilter.Conditions> <ig:ComparisonCondition Operator="Contains" /> </ig:ComboItemFilter.Conditions> </ig:ComboItemFilter> </ig:XamComboEditor.ItemFilters></ig:XamComboEditor>
However, to define a style for this control, based on one of your themes against it is not striaghtforward. There is a style defined for Infragistics.Windows.Editors.XamComboEditor but not for Infragistics.Controls.Editors.XamComboEditor.
<ResourceDictionary xmlns="">schemas.microsoft.com/.../presentation" xmlns:x="">schemas.microsoft.com/.../xaml" xmlns:editors="">infragistics.com/Editors" xmlns:igThemes="">infragistics.com/Themes"> <Style BasedOn="{x:Static igThemes:EditorsRoyalLight.XamComboEditor}" TargetType="{x:Type editors:XamComboEditor}"> <Setter Property="Margin" Value="3" /> </Style></ResourceDictionary>
Hi Somanna,
Thank you for posting to Infragistics Community!
I have been looking into your question and you are correct that styling the Infragistics.Controls.Editors.XamComboEditor based on any of the predefined themes would not be as straightforward as the Infragistics.Windows.Editors one, however, it is still possible. Hence, I am wondering if your question is about the approach to achieve this?
Assuming this is the case, and that the target theme would be RoyalLight, I will describe the approach to add a custom style to the Infragistics.Controls.Editors.XamComboEditor based on this theme.
It involves copying the RoyalLight.xamComboEditor.xaml and its dependent files (RoyalLight.Styles.xaml and RoyalLight.Theme.Colors.xaml) from the Infragistics DefaultStyles directory to your app. They can be found under:
C:\Program Files (x86)\Infragistics\*your version*\WPF\Themes\ RoyalLight
Once the relevant files are included, they can be merged in a ResourceDictionary and the custom style can be based on the corresponding RoyalLight one:
<Window.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source=" RoyalLight.xamComboEditor.xaml" /> </ResourceDictionary.MergedDictionaries> <Style TargetType="{x:Type ig:XamComboEditor}" BasedOn="{StaticResource XamComboEditorStyle}"> <Style.Setters> <Setter Property="Background" Value="#FFFBC6C6" /> </Style.Setters> </Style> <local:DataUtil x:Key="DataUtil" /> </ResourceDictionary> </Window.Resources>
Attached you will find a sample demonstrating this. Please, test it on your side and if you require any further assistance on the matter, please let me know.
Best regards,Bozhidara PachilovaAssociate Software Developer
7802.XCE_Input_RoyalLight_Theme.zip
Hi Bozhidara,
Thanks for getting back. Is this the only option? Ideally we don't want to keep a copy of the style which means whenever we upgrade to a newer version, the exercise of copying these will have to repeated.
Thanks,
Somanna
I believe this would be the approach to adopt, yes, and additionally I would not be too concerned with the frequency of updating the style files. The XamComboEditor (input) control is considered retired in terms of new development in favor to the Infragistics.Windows.Editors one, which can be used seamlessly as an editor in the XamDataGrid. Support and critical bug fixes are still being provided for the Infragistics.Controls.Editors.XamComboEditor, however, I do not believe that such could disrupt your implementation in terms of styling. In any case, if issues eventually arise, we will always be happy to assist you by confirming if there have indeed been any related changes that would require modification from your side as well in the future.
If you require any further assistance on the matter, please, let me know.
Best regards,Bozhidara Pachilova
Thanks.
We use v23.2 and don't see anything under C:\Program Files (x86).I don't recollect installing this either. Is there a link to the installed or another way to get hold of the sytle xamls?
The default styles are saved in the mentioned directory when installing the product with the installer. However, as of the latest version 23.2 and as per our documentation here, the Infragistics traditional installer has been removed, and so the WPF controls are now supported exclusively through NuGet moving forward. So, I assume your app is using the NuGet packages in this case, isn’t it?
Anyways, it is still possible to download these resources, as they are needed for scenarios such as the current. They can be found on the Customer Portal, under downloads. Under the WPF Product section you will find a bundle named “Ultimate UI for WPF 2023 Vol. 2 Product And Samples”. This will download an archive containing three installers. The one you need is named “Infragistics_WPF_20232”. After running it, the Default Styles directory should be under the following path, as mentioned: C:\Program Files (x86)\Infragistics\2023.2\WPF\DefaultStyles.
Just for the sake of the demo, I am also attaching a sample with the same code for styling the XamComboEditor (input), only in a project targeting .NET 6 and having the 23.2 latest release of Ultimate UI for WPF Trial installed as a NuGet package. As you will see, the result is the same.
If you require any further information, please, let me know.
3005.WpfApp1Net6.zip
Thanks a lot. Yes, we are using nuget packages.