Within a XamDataCards control via xaml I can add a Infragistics.Controls.Editors.XamComboEditor like so...
<dataPresenter:XamDataCards Name="dataCards" Theme="Aero">
<ig:XamComboEditor Name="xamComboEditor1" VerticalAlignment="Top" AllowMultipleSelection="True" CheckBoxVisibility="Visible" DisplayMemberPath="LastName" ItemsSource="{Binding}" /> </dataPresenter:XamDataCards>
But I cannot add it as a field via the field layouts, it results in a runtime exception of "FieldSettings.EditorType's must be set to a type that derives from ValueEditor\r\nParameter name: EditorType"...
<dataPresenter:XamDataCards Name="dataCards" Theme="Aero"> <dataPresenter:FieldLayout> <dataPresenter:FieldLayout.Fields> <dataPresenter:UnboundField Name="xamComboEditor1"> <dataPresenter:Field.Settings> <dataPresenter:FieldSettings EditorType="{x:Type editors:XamComboEditor}"> <dataPresenter:FieldSettings.EditorStyle> <Style TargetType="{x:Type editors:XamComboEditor}"> <Setter Property="ItemsSource" Value="{Binding}" /> <Setter Property="DisplayMemberPath" Value="LastName" /> <Setter Property="CheckBoxVisibility" Value="Visible" /> <Setter Property="AllowMultipleSelection" Value="True" /> <Setter Property="VerticalAlignment" Value="Top" /> </Style> </dataPresenter:FieldSettings.EditorStyle> </dataPresenter:FieldSettings> </dataPresenter:Field.Settings> </dataPresenter:UnboundField> </dataPresenter:FieldLayout.Fields> </dataPresenter:FieldLayout> </dataPresenter:XamDataCards>
Is there any way to make this possible or a work around to allow the editor to be added via the field layouts?
Thank you,
Jonathan
Hello Jonathan,
The issue here is that you are using a Shared XAML reference rather than the WPF Specific one.
With all DataPresenter family controls, you need to use the WPF Specific editors.
Your code is correct, but the reference you are using is Infragistics.Controls.Editors.XamComboEditors, which is the Shared XAML reference.
The one you really need is the one that reads Infragistics.Editors.
Please let me know if you have any questions or concerns.
Sincerely,AndrewDeveloper Support IInfragistics Inc.www.infragistics.com/support
But the Infragistics.Editors version does not support multiselect which is what I really need. Is there any way around this please?
Just checking in, do you have any other questions or concerns?
Hello,
To support multi-select you need to write a custom style and template for the CellValuePresenter and add the XamComboEditor from the Shared XAML reference.
The code for this is written below:<Style x:Key="MultiSelectorField1" TargetType="{x:Type igwpf:CellValuePresenter}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate> <ig:XamComboEditor AllowMultipleSelection="True ItemsSource="{Binding Source={StaticResource CarData}}"/>
</ControlTemplate> </Setter.Value> </Setter> </Style>
I have attached a sample project that demonstrates what this style does.