forum

home / developersection / forums / data bound combobox partially unclickable

Data Bound ComboBox partially unclickable

Anonymous User 2484 21-Sep-2013

I have some ComboBoxes set up like this:

    <ComboBox Name="CB_OS" Grid.Row="5" ItemsSource="{Binding OS_Sellection}" SelectedIndex="0" Margin="2" SelectionChanged="OSSelectionChanged">

        <ComboBox.ItemTemplate>

            <DataTemplate>

                <ComboBoxItem Content="{Binding Name}" IsSelected="{Binding IsSelected, Mode=TwoWay}"/>

            </DataTemplate>

        </ComboBox.ItemTemplate>

    </ComboBox>

The ComboBox fills with ComboBoxItems correctly, but clicking on the text (Content) does not select the Item. I must click elsewhere, where there is no text to actually change the selected item.

If I change it to this:

<ComboBox Name="CB_OS" Grid.Row="5" SelectedIndex="0" Margin="2" SelectionChanged="OSSelectionChanged">

            <ComboBoxItem Content="OOOOOOOOO"/>

            <ComboBoxItem Content="OOOOOOOOO"/>

            <ComboBoxItem Content="OOOOOOOOO"/>

</ComboBox>

it works fine.

OS_Selection contains only the following members:

private string name;

private bool isChecked;

private bool isSelected;

So my question is: How can I make the entire row (item) clickable?


wpf
Updated on 21-Sep-2013

I am a content writter !


Message
Can you answer this question?

Answer

1 Answers

Liked By