Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello guys, so I have two comboboxes:
XML
<ComboBox Height="35" HorizontalAlignment="Left" Margin="343,67,0,0" Name="comboBox2" VerticalAlignment="Top" Width="273" SelectionChanged="comboBox2_SelectionChanged"    >
            <ComboBox.Items>

                <ComboBoxItem IsSelected="True" Content="Trial"  />
                <ComboBoxItem IsSelected="True" Content="Limited" />
                <ComboBoxItem IsSelected="True" Content="Pernament" />




                </ComboBox.Items>
        </ComboBox>



and
XML
<ComboBox Height="35" HorizontalAlignment="Left" Margin="343,125,0,0" Name="comboBox1" VerticalAlignment="Top" Width="273" SelectionChanged="comboBox1_SelectionChanged">
            <ComboBoxItem Content="3 Months" IsSelected="True" />
            <ComboBoxItem Content="6 Months" />
            <ComboBoxItem Content="12 Months" />
            <ComboBoxItem IsSelected="True" Content="-" />
        </ComboBox>



I am trying to bind them for example if value of first box isn't Limited, second combo box should be disabled, and if Limited is selected in text box this date + months chosen must be displayed. Thanks for help in advance
Posted

1 solution

There is only onw thing to do in such a case, you will have to use an IValueConverter:
Data Binding Using IValueConverter in Silverlight[^]

You could bind the second combobox to isenabled and do the appropiate convertions from the selected values of the second one :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900