Home Forums WPF controls Other WPF controls WPF NavigableCombobox losing SelectedItem

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • dheerajk
    Post count: 2
    #43812 |


    I am faced with below query in my project.

    • We are using Xceed datagrid in our project to display information.
    • For every datacell, CellContentTemplate and CellEditor are applied.
    • We have also automated the user interface. UiSpy is the tool used to verify the automation properties being set.

    Below is the CellContentTemplate for one of the column :

    <DataTemplate x:Key=”DataCellTemplate”>
    <TextBlock Text=”{Binding}” HorizontalAlignment=”Center”></TextBlock>

    ItemContainerStyle for the datagrid is as below :

    <Style TargetType=”{x:Type xcdg:DataRow}”>
    <Setter Property=”AutomationProperties.AutomationId” Value=”{Binding DataDict[ELM_INT_ObjName].BindValue}”/>
    <Setter Property=”AutomationProperties.Name” Value=”{Binding DataDict[ELM_INT_ObjName].BindValue}”/>

    CellEditor code for the column is as follows :

    <!– Editor for Resolution –>
    <xcdg:CellEditor x:Key=”ResolutionEditor”>
    <xcdg:NavigableComboBox x:Name=”cmbResolutionOnGrid” BorderThickness=”0″ Background=”Transparent”
    DataContext=”{Binding Path=DataContext.PropCollection[Source_VideoResolution], RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=xcdg:DataGridControl}}”
    VerticalContentAlignment=”Top” MinHeight=”20″
    SelectedValuePath=”Key” DisplayMemberPath=”Value” Text=”Value”
    ItemsSource=”{Binding Path=ItemsSource}”
    FocusVisualStyle=”{StaticResource CustomFocusVisualStyle}”>

    • Below is the desclaration of the datagrid column :

    <xcdg:Column FieldName=”DataDict[VideoResolution].BindValue” Title=”Video Resolution”
    CellEditorDisplayConditions=”CellIsCurrent” CellContentTemplate=”{StaticResource DataCellTemplate}”
    CellEditor=”{StaticResource ResolutionEditor}” />


    • When we try to select combobox for the first time, it is visible in the UiSpy tool with the default value selected and IsOffScrren=False.
    [Please refer screenshot : Value_Display_Success.png]

    • On clicking the same datacell again, the combobox is displayed with selected value, but IsOffscreen remains true in UiSpy even though combobox is visible on screen.
    This is blocking automation as combobox is not getting detected and we are unable to modify the value.
    [Please refer screenshot : Value_Display_Failed.png]

    • As it appears, the SelectedItem for the comboBox is getting lost when the grid datacell is clicked second time.
    • AutomationId and Automation name for the combobox are also getting cleared after that.

    • Setting isEditable=True for combobox was not acceptable because dropdown was not opening by single clicking anywhere on combobox

    • Please do let your comments to help fix the issue.


    Post count: 2
    Fawzi [Xceed]
    Post count: 722

    Hi Dheeraj,

    Could you send me a simple stand alone sample project which reproduces the issue so that we could have a closer look. You may send it to: support@xceed.com

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