0

I defined a DataGrid in my WPF and I want to make some column headers appear in vertical form. In this other post, this is done via MVVM. But how can I do this in C# code?

In other words, the method that used MVVM changes the orientation of all column headers. But I want some of headers to be vertical.

4

1 回答 1

0

我在这里再次问了这个问题(不过以另一种形式)。接受的答案解决了我的问题。我建议未来有同样问题的读者参考那篇文章。总之,您必须为 定义多种样式,DataGridColumnHeader并为事件分配一个事件处理程序AutoGeneratingColumn。然后,以编程方式应用所需的样式。

似乎遵守 MVVM 模式是一种矫枉过正。

于 2016-09-06T06:04:06.567 回答