Skip to content

Selected Item of combobox enable = "false" #190

@superbigsoft

Description

@superbigsoft

Hi White team,

I have a small problem with controls have enable = "False"

For example, I have a wpf combo box define as:

<ComboBox Grid.Row="3" Grid.Column="1" x:Name="Gemeinde" DisplayMemberPath="Name" IsEnabled="False"/>

And I use white to get the selected value of this combobox

public ComboBox CbxGemeinde {
        get {
            if (m_cbxGemeinde == null) {
                m_cbxGemeinde = GetCombobox("Gemeinde");
            }
            return m_cbxGemeinde;
        }
    }
protected ComboBox GetCombobox(string controlId) {
        return Screen.Get(SearchCriteria.ByAutomationId(controlId)) as ComboBox;
    }

But the value get from combobox are:
combobox.SelectedItem is null,
combobox.Items is empty,
combobox.SelectedItemText = ""

Could you please help me check what wrong in getting selected value of combo box?

Thanks,
Nam

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions