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
60
Combobox in XamDataGrid Shows Empty
posted

OK, this has been driving me crazy all morning.  I have a XAMDataGrid and I am trying to put a combo box inside one of the cells.  It shows up ok, but the combo box remains empty no matter what I try.  I had this working in regular datagrid, but switching to the XAMDataGrid I cannot make it work.  Here's the code

<igDP:XamDataGrid AutoFit="True" DataSource="{Binding}">
                <igDP:XamDataGrid.FieldLayoutSettings>
                    <igDP:FieldLayoutSettings AutoGenerateFields="False" />
                </igDP:XamDataGrid.FieldLayoutSettings>
                <igDP:XamDataGrid.FieldLayouts>
                    <igDP:FieldLayout>
                        <igDP:FieldLayout.Fields>
                            <igDP:Field Name="Checked" Label="Output"/>
                            <igDP:Field Name="ColumnAlias" Label="Column"/>
                            <igDP:Field Name="selectedOperator" Label="Operator">
                            <igDP:Field.Settings>
                                <igDP:FieldSettings EditorType="{x:Type igEditors:XamComboEditor}">
                                    <igDP:FieldSettings.EditorStyle>
                                        <Style TargetType="{x:Type igEditors:XamComboEditor}">
                                            <Setter Property="ItemsSource" Value="{Binding Operator}"/>
                                            <Setter Property="SelectedItem" Value="{Binding selectedOperator}" />
                                        </Style>
                                    </igDP:FieldSettings.EditorStyle>
                                </igDP:FieldSettings>
                            </igDP:Field.Settings>

                        </igDP:Field>
                        <igDP:Field Name="Criteria" Label="Criteria"/>
                        </igDP:FieldLayout.Fields>
                    </igDP:FieldLayout>
                </igDP:XamDataGrid.FieldLayouts>
            </igDP:XamDataGrid>

Operator is an observablecollection<string> property defined as..

        private ObservableCollection<string> _operator = new ObservableCollection<string>()
            {"=","<>",">",">=","<","<=","IN","IS NULL","IS NOT NULL"};
        public ObservableCollection<string> Operator { get { return _operator; } }

 

Everything else binds correctly, but the combo box shows empty.  Any ideas?