Search code examples
c#gridviewdevexpressgridcontroldevexpress-gridcontrol

How to enable append button to GridControl EmbeddedNavigator?


I have simple questions how to enable the append button in my 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.


Solution

  • It's possible to show the Append button only if the grid's DataSource supports the IBindingList interface and its AllowNew method returns true. Otherwise, it's not clear how GridControl should add a new record. If your datasource doesn't implement IBindingList, consider using the standard BindingList class instead.

    Alternatively, you can create custom buttons using the CustomButtons property.