如何在wpf中动态地向datagridcell添加控件 [英] How to add controls dynamically to datagridcell in wpf
本文介绍了如何在wpf中动态地向datagridcell添加控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想基于datagridcomboboxcolumn选择的值动态地将控件添加到特定单元格。请帮助
解决方案
请参阅我对该问题的评论。具体方法如下: ContentControl.Content属性(System.Windows.Controls) [ ^ ]。
您应该了解系统。 Windows.Controls.DataGridCell
System.Windows.Controls.ContentControl
。
此时,解决方案对您来说应该是非常明显的,但如果还不是很清楚,则意味着您必须更好地学习WPF 内容模型: WPF内容模型 [ ^ ]。
< DD> -SA
I want to add controls dynamically to particular cell based on datagridcomboboxcolumn selected value. Please help
解决方案
Please see my comment to the question. This is how: ContentControl.Content Property (System.Windows.Controls)[^].
You should understand thatSystem.Windows.Controls.DataGridCell
isSystem.Windows.Controls.ContentControl
.
At this point, the solution should be pretty obvious to you, but if it's not quite clear yet, it means that you have to learn WPF content model better: WPF Content Model[^].
—SA
这篇关于如何在wpf中动态地向datagridcell添加控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文