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

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

问题描述

我正在使用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 datagrid行选择器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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