Home Forums WPF controls Other WPF controls WPF NavigableCombobox losing SelectedItem

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

    Hello,

    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>
    </DataTemplate>

    ItemContainerStyle for the datagrid is as below :

    <xcdg:DataGridControl.ItemContainerStyle>
    <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}”/>
    </Style>
    </xcdg:DataGridControl.ItemContainerStyle>

    CellEditor code for the column is as follows :

    <!– Editor for Resolution –>
    <xcdg:CellEditor x:Key=”ResolutionEditor”>
    <xcdg:CellEditor.EditTemplate>
    <DataTemplate>
    <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”
    SelectedValue=”{xcdg:CellEditorBinding}”
    ItemsSource=”{Binding Path=ItemsSource}”
    FocusVisualStyle=”{StaticResource CustomFocusVisualStyle}”>
    </xcdg:NavigableComboBox>
    </DataTemplate>
    </xcdg:CellEditor.EditTemplate>
    </xcdg:CellEditor>

    • 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}” />

    Query

    • 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.

    Thanks,
    Dheeraj

    dheerajk
    Participant
    Post count: 2
    Fawzi [Xceed]
    Member
    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.