在wpf datagrid中冻结列 [英] Freezing columns in wpf datagrid

查看:637
本文介绍了在wpf datagrid中冻结列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些表格数据,其中有很多字段,当我的WPF应用程序调整大小时,很多都被切断。但是,我想看到前6列总是重要的。如何以网格格式实现?我正在使用WPFToolkit DataGrid,但如果存在,可以说服更改为不同的控件。



现在,我正在使用两个不同的DataGrids,其中最右侧的DataGrid与滚动浏览器中的最右侧的数据网格水平滚动,垂直滚动关闭。我也必须同步两个排序目的或禁用排序。

解决方案

好的,这个控件很简单,所有你需要做的是设置FrozenColumnCount =6,在我的情况下。也许别人会需要这个,他们可以笑我的愚蠢。


I have some tabular data which has a lot of fields in it, and when my WPF application is resized a lot of them are cut off. However, I want to see the first 6 columns always as they are important. How can I achieve this in a grid format? I am using the WPFToolkit DataGrid but can be persuaded to change to a different control if one exists.

Right now, I am using two different DataGrids side by side with the right most datagrid inside a scrollviewer with horizontal scrolling on and the vertical scrolling off. I will also have to either sync the two for sorting purposes or disable sorting altogether.

解决方案

Okay, it's trivial in that control, all you have to do is set FrozenColumnCount = "6", in my case. Maybe someone else will need this and they can laugh at my stupidity.

这篇关于在wpf datagrid中冻结列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆