wpf如何在代码中实现<DataGridTextColumn Binding="{Binding Name}"/>Binding的邦定?
答案:1 悬赏:20 手机版
解决时间 2021-02-05 03:12
- 提问者网友:愿为果
- 2021-02-04 04:02
wpf如何在代码中实现<DataGridTextColumn Binding="{Binding Name}"/>Binding的邦定?
最佳答案
- 五星知识达人网友:神的生死簿
- 2021-02-04 05:40
var newCol = new DataGridTextColumn();
newCol.Binding = new Binding("SdDevDuration");
var visiblityBinding = new Binding("IsVisible");
visiblityBinding.Source = col;
visiblityBinding.Converter = new VisibilityConverter();
BindingOperations.SetBinding(newCol, DataGridTextColumn.VisibilityProperty, visiblityBinding);//类似这样你先试下追问其实new Binding("aa);就能达到我需要的效果。谢谢你的提示。
newCol.Binding = new Binding("SdDevDuration");
var visiblityBinding = new Binding("IsVisible");
visiblityBinding.Source = col;
visiblityBinding.Converter = new VisibilityConverter();
BindingOperations.SetBinding(newCol, DataGridTextColumn.VisibilityProperty, visiblityBinding);//类似这样你先试下追问其实new Binding("aa);就能达到我需要的效果。谢谢你的提示。
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯