如何冻结WPF网格的第一行和第一列 [英] How to freeze the first row and first column of a WPF grid
本文介绍了如何冻结WPF网格的第一行和第一列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以冻结WPF中网格(不是数据网格)的第一行和第一列?我的应用程序有一个包含折线图控件的网格,我希望第一行包含在垂直滚动时保持静止的标签,而第一列则保留在水平滚动时保持静止的标签.
谁能分享有关此操作的示例?
Is there a way to freeze the first row and first column of a grid (not data grid) in WPF? My application has a grid that contain line chart controls and I would like to have the first row to hold labels that would stay still as I scroll vertically and for the first column to hold labels that stay when I scroll horizontally.
Can anyone share an example on how to do this?
推荐答案
此处是指向 ^ ].
确实在网格中使用了DataGridView,尽管您没有说出为什么不这样做,但是您说过您并不想使用它.
此外部文章使用 Infragistics的xamGrid [ ^ ]相同效果.
但是Grid类并非设计为具有非滚动列或行.这就是DataGrid(或Grid内的DataGridView)的用途. (如果使用Infragistics类,则为xamlGrid)
-杰西(Jesse)
Here is an external link to an article that talks about fixing the first N columns[^].
It does happen to use a DataGridView in the Grid, which you said you didn''t really want to use, though you didn''t say why you didn''t.
This external article uses xamGrid by Infragistics[^] for the same effect.
But the Grid class is not designed to have non-Scrolling columns or rows. That is what DataGrid (or a DataGridView inside a Grid) is for. (and xamlGrid if you are using the Infragistics classes)
-Jesse
这篇关于如何冻结WPF网格的第一行和第一列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文