如何隐藏 wpf 数据网格行选择器 [英] How Do I Hide wpf datagrid row selector

查看:19
本文介绍了如何隐藏 wpf 数据网格行选择器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 WPF DataGrid 控件来显示一些详细信息和一个选择按钮,我不需要左侧下方的灰色选择器列.这也破坏了我设计的美感.

I'm using the WPF DataGrid control to show some details and a select button, and I don't need the gray selector column down the left-hand side. It's also ruining the beauty of my design.

有没有办法删除它,或者如果没有,我该如何设置匹配的样式?

Is there a way to remove it, or how can I style it to match if not?

推荐答案

使用 RowHeaderWidth 属性:

<my:DataGrid RowHeaderWidth="0" AutoGenerateColumns="False" Name="dataGrid1" />

请注意,您也可以为其指定样式或模板,如果您决定真的喜欢它并希望保留它,因为您可以用它做一些很酷的事情.

Note that you can also specify a style or template for it also, should you decide you really do like it and want to keep it because you can do something cool with it.

这篇关于如何隐藏 wpf 数据网格行选择器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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