Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
240
XamComboEditor with MultipleSelection in XamDataGrid
posted

Hi there,

I need in my XamDataGrid some XamComboBoxes with AllowMultipleSelection=true and I've found in your forum a topic with an uncompleted solution that could offers a way to solve my issue. In http://www.infragistics.com/community/forums/t/87945.aspx Andrew Goldenbaum describe need of custom style and template for the CellValuePresenter and add the XamComboEditor from the Shared XAML reference. But this is for XamDataCard. I want to insert this in my usercontrol.resource part. Here my XAML:

<Style x:Key="MultiSelectorFieldSwitches" TargetType="{x:Type igWPF:CellValuePresenter}">
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate>
                <ig:XamComboEditor AllowMultipleSelection="True"
                    CheckBoxVisibility="Visible"
                        DisplayMemberPath="@text"  
                        SelectedValuePath="@value"
                        ItemsSource="{Binding Source={StaticResource SwitchesXml}}"/>
             </ControlTemplate>
          </Setter.Value>
    </Setter>
</Style>


and in XamDataGrids FieldLayout

<igDP:Field Name="Switch" Label="Schalter">
    <igDP:Field.Settings>
        <igDP:FieldSettings EditorStyle="{StaticResource MultiSelectorFieldSwitches}" />
    </igDP:Field.Settings>
</igDP:Field>

But there is the error "FieldSettings.EditorStyle's TargeType setting can only be null or a type that derives from ValueEditor or is a BaseClass of ValueEditor, CellValuePresenter is invalid.".

I've read in the styling points for XamDataGrid in your online documentation 2014.2 that CellValuePresenter is the target of custom styles for XamDataGrid. What do I have to reference as target or is it false in general?



If I try following XAML-Code

<igDP:TemplateField Name="Switch" Label="Schalter">
    <igDP:TemplateField.DisplayTemplate>
        <DataTemplate>
             <ig:XamComboEditor
                 SelectedItems="{igEditors:TemplateEditorValueBinding}"/>
           </DataTemplate>
    </igDP:TemplateField.DisplayTemplate>
    <igDP:TemplateField.EditTemplate>
    <DataTemplate>
            <ig:XamComboEditor
             AllowMultipleSelection="True"
                CheckBoxVisibility="Visible"
                ItemsSource="{Binding Source={StaticResource SwitchesXml}, XPath=/Switches/Switch}" />
        </DataTemplate>
     </igDP:TemplateField.EditTemplate>
</igDP:TemplateField>

MultiSection and CheckboxVisibility works for me, but only the visibility, not the realy items. I can only see the word "Switch" for each of all items, is this a binding issue? And also XAML for DisplayTemplate is bad because change focus on another field text of that field disappear.

I hope on you, thank you in advance
Andreas

Parents Reply Children