Home Forums WPF controls Xceed DataGrid for WPF combo box CellEditor

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #24680 |

    Hopefully this will be obvious to someone. I’ve got a combo box cell editor that I use in my CardView. Everything works ok with it except that after selecting one of the options in the combo and moving focus elsewhere in the application, the selected value is reset back to the original binding value, no matter which option I select. Here is the XAML for my editor:

    <xcdg:CellEditor x:Key=”statusEditor”>
    <xcdg:CellEditor.EditTemplate>
    <DataTemplate>
    <ComboBox Grid.Row=”2″ BorderThickness=”1″ MinHeight=”22″
    VerticalContentAlignment=”Top”
    SelectedValuePath=”Status”
    ItemsSource=”{Binding Source={x:Static Application.Current},Path=Status}”
    >
    <ComboBox.Resources>
    <Style TargetType=”Popup”>
    <Setter Property=”TextElement.Foreground” Value=”{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}” />
    </Style>
    </ComboBox.Resources>
    <ComboBoxItem>Approved</ComboBoxItem>
    <ComboBoxItem>Empty</ComboBoxItem>
    <ComboBoxItem>Ignore</ComboBoxItem>
    </ComboBox>
    </DataTemplate>
    </xcdg:CellEditor.EditTemplate>
    <xcdg:CellEditor.ActivationGestures>
    <xcdg:KeyActivationGesture SystemKey=”Down”
    Modifiers=”Alt”/>
    <xcdg:KeyActivationGesture Key=”Up”
    Modifiers=”Alt”/>
    <xcdg:KeyActivationGesture Key=”F4″/>
    <xcdg:KeyActivationGesture Key=”Space”/>
    </xcdg:CellEditor.ActivationGestures>
    </xcdg:CellEditor>

    Does anyone have an idea why this is happening?

    Imported from legacy forums. Posted by brent (had 561 views)

    Xceed Support
    Member
    Post count: 5658

    In your cell editor you have to bind the SelectedValue of the ComboBox to the Cell’s content…

    This can be done by using the “{xcdg:CellEditorBinding}” markup extension…

    You can refer to <a href=”http://doc.xceedsoft.com/products/XceedWpfDataGrid/Custom%20Cell%20Editors.html”>this article for more details</a>.

    Imported from legacy forums. Posted by Marcus [Xceed] (had 2810 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.