ComboBox doesn't fire SelectionChanged event

Posted by Budda on Stack Overflow See other posts from Stack Overflow or by Budda
Published on 2010-05-28T23:53:54Z Indexed on 2010/05/29 0:02 UTC
Read the original article Hit count: 513

Subj.

I am using Silverlight 4 with VS2010, here is a source code:

        <ComboBox Grid.Row="4" Grid.Column="1" Name="Player2All" MinWidth="50" ItemsSource="{Binding PlayersAll}"  SelectionChanged="Player2All_SelectionChanged">
            <ComboBox.ItemTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding ShortName}"/>
                </DataTemplate>
            </ComboBox.ItemTemplate>
        </ComboBox>

Here is code behind function:

    private void Player2All_SelectionChanged(object sender, SelectionChangedEventArgs e)
    {
        OpenFileDialog ofd = new OpenFileDialog();
        ofd.ShowDialog();
        string strPlayerSelected = sender.ToString();

        DebugTextBlock.Text = "hoho";
    }

This function is not called when I change selected item... Why? How can I get that workable?

many thanks for any help.

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about events