如何冻结WPF中的datagrid列 [英] how to freeze the datagrid column in WPF

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

问题描述

冻结前两列,但如果我想像第3或第4个动态冻结列,我该如何做到这一点

freeze the first two column but if I want to freeze the column dynamically like 3rd or 4th one how I could do this

推荐答案

p>您可以使用变量 FrozenColumnCount ,它将设置冻结网格中最左列的数量

You can work with variable FrozenColumnCount which will set the number of leftmost columns in the grid that are frozen

但是如果你想冻结只说第三列,那我认为你需要编写自定义控件。在datagrid中,最左边的列可以被冻结。

However if you want to freeze only say the third column, then I think you need to write a custom control. In a datagrid only the leftmost columns can be frozen.

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

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