Click here to Skip to main content
15,032,251 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

We have the grid and combobox outside of the grid. If we click on the grid row, grid column(2) data should reflect on the combobox as selected value.
Please find the below code:
<ComboBox x:Name="cboSkillset" DisplayMemberPath="technologyID" SelectedValue="skillid" FontWeight="Bold" Canvas.Left="120" Canvas.Top="68" Width="200" Height="25"></ComboBox>

private void Grid_SelectionChanged(object sender, SelectionChangedEventArgs e){
      //Loading combobox
      cboSkillSetLevel.ItemsSource = DBContext.Lookups;
      DBContext.Load(DBContext.GetLookupsQuery(1)); 


      TextBlock Txt_Skill = (TextBlock) Grid.Columns[2].GetCellContent(Grid.SelectedItem);


//here how can we assign selected value of combobox

cboSkillSetLevel.selecteditem = Txt_Skill.Text;

}
Posted

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