1

How does one Call the Onclick event for cxGrid Navigator buttons? I can't seem to find it.

Screenshot below...

enter image description here

Thanks,

Sharpie
  • 373
  • 2
  • 15
  • 34
  • https://www.devexpress.com/Support/Center/Question/Details/Q380797 says ".NavigatorButtons.OnButtonClick event and AButtonIndex parameter; the latter identifies a clicked button" – Anthony Eischens Sep 24 '15 at 16:27

1 Answers1

2

In the following example View is the TcxGridDBTableView owning the Navigator:

The Navigator Buttons are exposed via a property on View called NavigatorButtons. NavigatorButtons is of type TcxNavigatorControlButtons

On TcxNavigatorControlButtons you'll find all you buttons:

  TcxNavigatorControlButtons = class(TcxCustomNavigatorButtons)
  ...
  published
    property ConfirmDelete;
    property CustomButtons;
    property Images;

    property First;
    property PriorPage;
    property Prior;
    property Next;
    property NextPage;
    property Last;
    property Insert;
    property Append;
    property Delete;
    property Edit;
    property Post;
    property Cancel;
    property Refresh;
    property SaveBookmark;
    property GotoBookmark;
    property Filter;
  end;

So if you want to click on the "Next" button you could write

  View.NavigatorButtons.Next.Click;

IF and only IF the button is enabled then the OnClick event will fire.

There are 16 buttons, each one defined byt it's own index:

const
  NavigatorButtonCount = 16;

  NBDI_FIRST        = 0;
  NBDI_PRIORPAGE    = 1;
  NBDI_PRIOR        = 2;
  NBDI_NEXT         = 3;
  NBDI_NEXTPAGE     = 4;
  NBDI_LAST         = 5;
  NBDI_INSERT       = 6;
  NBDI_APPEND       = 7;
  NBDI_DELETE       = 8;
  NBDI_EDIT         = 9;
  NBDI_POST         = 10;
  NBDI_CANCEL       = 11;
  NBDI_REFRESH      = 12;
  NBDI_SAVEBOOKMARK = 13;
  NBDI_GOTOBOOKMARK = 14;
  NBDI_FILTER       = 15;

If you prefer you can ude this index to click a certain button:

 View.NavigatorButtons.ClickButton(NBDI_EDIT);

Hope this answers your question.

Jens Borrisholt
  • 6,174
  • 1
  • 33
  • 67