21.10 How to Setup a Button and Page Relationship
Sep/26/2008
When
building custom screens it is important that you can hook up the button in the
Ribbon for that form correctly to the page in question and ensure that all of
the correct events fire. To ensure this please follow this methodology:
On your
button that you create, set the "Tag" property to the name of the Page that you
wish to have selected.
In the
Click event for the button call the SelectPage method that is inherited
from the base class passing your button. We suggest that you create a common
declaration for each screen that all buttons on your Ribbon Control call such as
this:
private void
SelectPage(object sender, EventArgs e) {
DevComponents.DotNetBar.ButtonItem bi =
sender as DevComponents.DotNetBar.ButtonItem;
if (bi == null) return;
SelectPage(bi);
}