HI,
I have combo box control with button control inside(red button on the left side). When I click the button I want to open appropriate window to edit selected item. If I can find selected item in current control then I can easy open appropriate window. I have few combo boxes with different type of data and different window to open if button is clicked. My problem is to find selected item.
Here is how combo box look like http://picasaweb.google.com/118216385786728058155/Public#5495556955853206546
Koteswararao MallisettiPosted Jul 19, 2010, 9:37 AM
See this code i this i take 2 button in each button i take commandparameter value as 1 ,2 when we select appropriate button i display message box with which button is clicked i passed the code to you if it is satisfies your need ,if not plz give feed back after modify accourding your needs.
<StackPanel Orientation="Horizontal">
<ComboBox Height="41" Width="221">
<ComboBoxItem Name="ind" IsSelected="True">IndiaComboBoxItem>
<ComboBoxItem Name="pakistan">
<Button Content="pakistan" CommandParameter="1" Click="Button_Click">Button>
ComboBoxItem>
<ComboBoxItem Name="chaina">
<Button Content="chaina" CommandParameter="2" Click="Button_Click">Button>
ComboBoxItem>
ComboBox>
StackPanel>
c# code:
private void Button_Click(object sender, RoutedEventArgs e)
{
MessageBox.Show(((Button)sender).CommandParameter +" button is clicked");
}
Rade sdasdPosted Jul 19, 2010, 7:28 AM
Koteswararao MallisettiPosted Jul 19, 2010, 7:09 AM