Hi is it possible to provide an example of setting the Validation.ErrorTemplate" on the XamComboEditor.
I know you can do something like the following on the normal WPF controls
<Setter Property="Validation.ErrorTemplate"> <Setter.Value> <ControlTemplate> <DockPanel DockPanel.Dock="Right"> <AdornedElementPlaceholder> <Border BorderBrush="Red" BorderThickness="2" /> </AdornedElementPlaceholder> <TextBlock Margin="3" Text="*" Foreground="Red" ToolTip="{Binding Path=AdornedElement.ToolTip, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Adorner}}}" /> </DockPanel> </ControlTemplate> </Setter.Value> </Setter>
But this does not work on the XamComboEditor
Hello Ludwig,
Thank you for your post on this matter.
At this time, there are actually two XamComboEditor elements in the Infragistics for WPF toolset – the Infragistics.Controls.Editors.XamComboEditor and the Infragistics.Windows.Editors.XamComboEditor. Can you please provide some more details on the one that you are currently using?
If you are unsure, providing the assembly references and the xmlns namespace definition you are using in your project may be able to help me know this.
Please let me know if you have any other questions or concerns on this matter.
Hello Andrew.
Yes sorry for not supplying that information.
I am using the Infragistics.Windows.Editors.XamComboEditor control.
What is the difference between the two XamComboEditors?
Thank you for confirming which XamComboEditor you are using.
The difference between these two XamComboEditors is that the “shared” one, as it was available on Silverlight as well as a shared code-base – the Infragistics.Controls.Editors.XamComboEditor was designed to be more of a standalone editor and it supports multiple selection. The other one – the Infragistics.Windows.Editors.XamComboEditor – was actually designed as an editor for the XamDataGrid and does not support multiple selection.
Relating to modifying the error templates for the two, it should be possible to just modify the Validation.ErrorTemplate for the Infragistics.Windows.Editors.XamComboEditor. With the Infragistics.Controls.Editors.XamComboEditor though, you need to modify the default template as there is a Border element named ValidationErrorElement that appears when an error is present.
I am attaching a sample project to demonstrate both ways of modifying the error templates of XamCombEditors. I hope this helps.
ComboEditorErrorTemplates.zip
Thank you Andrew.
Much appreciated