如何删除 Wpf 数据网格中的默认行 [英] How to Remove Default Row In Wpf data Grid

查看:15
本文介绍了如何删除 Wpf 数据网格中的默认行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 WPF 数据网格.无论何时加载,都会有一个空白的默认行.如何禁止默认行像在 Windows 窗体网格中那样显示.

I am using a WPF Data Grid. Whenever it is loaded there is a blank default row. How can I disable the default row from appearing like you can in the Windows Forms grid.

推荐答案

这是新条目的行.如果您不想让用户创建新条目,或者您从代码中处理此问题,例如使用添加按钮,禁用 CanUserAddRows 选项.

This is the row for new entries. If you don't want let the user create new entries or if you handle this from code, e.g. with a add-button, disable the CanUserAddRows-option.

<DataGrid  CanUserAddRows="False" />

这篇关于如何删除 Wpf 数据网格中的默认行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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