简体   繁体   English

如何启用GridControl EmbeddedNavigator的附加按钮?

[英]How to enable append button to GridControl EmbeddedNavigator?

I have simple questions how to enable the append button in my GridControl. 我有简单的问题,如何在GridControl中启用附加按钮。 I have tried lot of things like: 我尝试了很多事情,例如:

GridView.OptionsView.ShowButtonMode = DevExpress.XtraGrid.Views.Base.ShowButtonModeEnum.ShowAlways;
GridControl.EmbeddedNavigator.OptionsBehavior.AllowAddRows = true;
GridControl.EmbeddedNavigator.Buttons.Append.Enable = true;
GridControl.EmbeddedNavigator.Buttons.Append.Visible = true;
GridControl.EmbeddedNavigator.Enable = true;
GridControl.EmbeddedNavigator.Visible = true;

I run out of idea how to solve this simple task. 我不知道如何解决这个简单的任务。 Please help me. 请帮我。

I use DevExpress Version 18.1.5. 我使用的是DevExpress版本18.1.5。

It's possible to show the Append button only if the grid's DataSource supports the IBindingList interface and its AllowNew method returns true . 仅当网格的DataSource支持IBindingList接口并且其AllowNew方法返回true时,才可能显示Append按钮。 Otherwise, it's not clear how GridControl should add a new record. 否则,不清楚GridControl应该如何添加新记录。 If your datasource doesn't implement IBindingList , consider using the standard BindingList class instead. 如果您的数据源未实现IBindingList ,请考虑使用标准的BindingList类。

Alternatively, you can create custom buttons using the CustomButtons property. 或者,您可以使用CustomButtons属性创建自定义按钮。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM