选择的网格视图行单元格数据应填充为组合框中的选定项目 [英] seleted grid view row cell data should populate as a selected item in combo box

查看:75
本文介绍了选择的网格视图行单元格数据应填充为组合框中的选定项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



我们在网格之外有网格和组合框。如果我们点击网格行,网格列(2)数据应该在组合框上反映为选定值。

请找到以下代码:

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;

}

推荐答案

这篇关于选择的网格视图行单元格数据应填充为组合框中的选定项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆