关于wpf SelectionChanged事件,给combox赋不上值
private void vcategory1099Combox_SelectionChanged(object sender, SelectionChangedEventArgs e){
System.Data.DataRowView dv = vcategory1099Combox.SelectedValue as System.Data.DataRowView;
if (dv != null)
{
string value = dv.Row["vcategoryname"].ToString();
if (value.Equals(this.FindResource("addaNew").ToString()))
{
Accounting.pop.add_category_1099 pop = new Accounting.pop.add_category_1099();
pop.WindowStartupLocation = WindowStartupLocation.CenterScreen;
if (pop.ShowDialog() == true)
{
BindingCom();
vcategory1099Combox.SelectedValue = pop.returnID;
}
}
}
}
为什么在SelectionChanged事件,怎么都设不上combox的值呢?(各种方法都不使)
以上代码大该意思当用户选择了 addNew 就弹出页新增,关闭后combox刷新并选择新增那条数据。 WPF
补充:.NET技术 , C#