views:

25

answers:

2

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.

P.S. Created a separate application... similar code works fine.

A: 

Could it be that you are binding it to PlayersAll while everything else is refering to Player2? I'm not sure exactly without seeing the rest of your code, but if you are binding this to the wrong thing then there wouldn't be any perceived change would there?

Daisetsu
I see items in the drop-down list of the ComboBox.. So, it should be correct binding, shouldn't be?
Budda
A: 

The problem was in the ComboBox and syntax. xap-file of the app was not be updatable (due to configuration error of the Silverlight App). When that was resolved - ComboBoxes started work :)

Thanks.

Budda