[英]How can I get the default ControlTemplate of DataGridTextColumn?
I wanna custom the ControlTemplate of DataGridTextColumn. 我想自定义DataGridTextColumn的ControlTemplate。 I always get the default ControlTemplate via this: 我总是通过以下方式获取默认的ControlTemplate:
1. Right-click the control. 1.右键单击该控件。
2. Edit Template. 2.编辑模板。
3. Edit a copy. 3.编辑副本。
Just as the image shows below: 如下图所示:
However, I can see the DataGridTextColumn in the designer so that I can't right click it. 但是,我可以在设计器中看到DataGridTextColumn,因此无法右键单击它。
So how can I get the default ControlTemplate of it? 那么如何获得它的默认ControlTemplate? Please help me. 请帮我。 Thank you. 谢谢。
A DataGridTextColumn
is not a Control
and has no ControlTemplate
. DataGridTextColumn
不是Control
,并且没有ControlTemplate
。
It generates a TextBlock
in its GenerateElement
method and a TextBox
in its GenerateEditingElement
method. 它在其GenerateElement
方法中生成一个TextBlock
,并在其GenerateEditingElement
方法中GenerateEditingElement
一个TextBox
。 You'll find the source code here . 您可以在此处找到源代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.