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
565
Problem: ComboBox SelectedItem = null when enter edit mode
posted

This is how the combo box is defined in editor template in XAML:
                            <igGrid:TemplateColumn.EditorTemplate>
                                <DataTemplate>
                                    <ComboBox SelectedItem="{Binding bbbb}">
                                        <System:Int32>0</System:Int32>
                                        <System:Int32>1</System:Int32>
                                        <System:Int32>2</System:Int32>
                                        <System:Int32>3</System:Int32>
                                    </ComboBox>
                                </DataTemplate>
                            </igGrid:TemplateColumn.EditorTemplate>
The drop down shows 0, 1, 2, and 3. The Selected Item is bound to bbbb. After selecting an item, the item is successfully updated into the grid.

But, when entering edit mode Selected Item is null. Even when I set the value in CellEnteredEditModeEvent:
     private void _igrid_CellEnteredEditMode(object sender, Infragistics.Silverlight.EditingCellEventArgs e)
        {
           if (e.Editor.GetType() == typeof(ComboBox))
           {
               ((ComboBox)e.Editor).SelectedItem = e.Cell.Value;
           }
     }
This results in the drop down being empty instead of displaying the current value.
However, I can assign the value in the debugger and it works correctly.