即使在启用CanUserAddRows ="True"之后,数据网格也不会在数据网格的末尾显示新行. [英] The datagrid does not display a new row at the end of the datagrid, even after enabling CanUserAddRows="True".

查看:69
本文介绍了即使在启用CanUserAddRows ="True"之后,数据网格也不会在数据网格的末尾显示新行.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我创建了一个应用程序,该应用程序根据从组合框选择的内容将数据加载到数据网格中.数据网格使用一个集合,该集合使用datacontext(DataGrid1.DataContext = Language.Languages.Nodes;)绑定到数据网格.我加了 添加,删除和编辑按钮.一切正常,除了添加.数据网格在数据网格末尾不显示新行,即使设置后,用户也可以向该数据网格添加新元素 CanUserAddRows . 请为此提供帮助.

Hello all,
 I have created a application, which loads the data to a datagrid depending upon the selection from a combobox. The datagrid uses a collection, which im binding to the datagrid using datacontext( DataGrid1.DataContext = Language.Languages.Nodes;). I added add, delete and edit buttons. Everything works fine, except add. The datagrid doesnot show a new row at the end of the datagrid to enable the user to add a new element to the datagrid, even after setting CanUserAddRows="True". Please help me regarding this.

感谢和问候,
Shilpa

Thanks and regards,
Shilpa

推荐答案

您好Shilpa,

Hi Shilpa,

您可以查看Vincent Sibal撰写的此博客文章:

You can check this blog post by Vincent Sibal: http://blogs.msdn.com/b/vinsibal/archive/2008/10/01/overview-of-the-editing-features-in-the-wpf-datagrid.aspx. I think this still apply to .NET 4.0 DataGrid. If you read it, you can see that there are other properties that may affect the value of CanUserAddRows. It is possible that the underlying IEditableCollectionView object has the CanAddNew property set to false. Hope this helps.

此致

迈克


这篇关于即使在启用CanUserAddRows ="True"之后,数据网格也不会在数据网格的末尾显示新行.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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