Search
English
Managing the Properties of the TToolbox Panel

Adding Custom Buttons

The TOLAPControlGeneralfont..Toolbox property provides an access to the panel of tools buttons of the Grid.
The example shows how to add a button called "Sample Button" with the Sample_EventHandler to the set of panel’s buttons.

ToolStripButton sampleButton = new ToolStripButton();
sampleButton.Text = "Sample button";
sampleButton.Click += new EventHandler(Sample_EventHandler);
GridTable.Toolbox.Items.Add(sampleButton);

Toolbox with the added button

Managing the Buttons’ Properties

To manage the buttons’ property, you need to specify the TOLAPControlGeneral.ShowToolboxButton event handler, make sure that its e.ItemType argument’s field contains the button’s code (type), and change the appropriate property, available through e.Item.

This event handler is executed when it is assigned (the first call) and upon changing the Grid state.

Example:
The example code makes the PrintPreview and ZoomGroup buttons unavailable and hides the Palette, Skin and PanelsGroup buttons.

GridTable.ShowToolboxButton += new
ShowToolboxButtonEventHandler(GridChart_ShowToolboxButton);

void GridChart_ShowToolboxButton(object sender, ShowToolboxButtonEventArgs e)
{
switch (e.ItemType)
{
case ToolboxButtons.PrintPreview:
case ToolboxButtons.ZoomGroup:
e.Item.Visible = true;
e.Item.Enabled = false;
break;
case ToolboxButtons.ApplyPalette:
case ToolboxButtons.ApplySkin:
case ToolboxButtons.PanelsGroup:
e.Item.Visible = false;
break;
}
}

Standard view of the toolbox.

The view of the toolbox after using the event handler.

To refresh the buttons’ properties, you need to call the TOLAPControlGeneral.RefreshToolboxItems() manually. This will cause the execution of the TOLAPControlGeneral.ShowToolboxButton event handler for all the Grid’s buttons.

Calling the Toolbox Commands

The toolbox commands are called through the TOLAPControlGeneral.ToolboxCallCommand(ToolboxButtons AButtons) method with the button’s code (type) passed as a parameter. If the call is successful, the method returns true.

Example: calling the print preview command

GridTable.ToolboxCallCommand(ToolboxButtons.PrintPreview);

Placing the Toolbox Outside the Grid

You can use the toolbox separately from the Grid; that is place on the form an external toolbox as a separate component and set the TToolbox.Grid property (without this property toolbox buttons will be unavailable).
At that, the properties of toolbox buttons will be amended according to the Grid’s settings and its internal toolbox will be hidden. To restore the latter, you need to set the former’s Grid property to null. This will make the external toolbox buttons visible, but unavailable.
The same way a single toolbox may be used with several Grids, connected in turn to each selected Grid.

The view of an external toolbox, not connected to the Grid.

The view of an external toolbox, connected to the Grid.

Related links

Download Radar-Soft products


Buy Radar-Soft products


Visit our support site


Hot news
Click to subscribe

 July 22, 2010

RadarCube for WPF beta is here

The new RadarCube for WPF version has started.

Details...

 

Latest versions
Click to subscribe

 July 14, 2010

RadarCube ASP.NET 2.44.3

Changes...Download...

 

 June 25, 2010

RadarCube WinForms Desktop 2.31.0

Changes...Download...

 

 June 25, 2010

RadarCube WinForms MSAS 2.31.0

Changes...Download...

 

 May 20, 2010

RadarCube VCL 1.18.0

Changes...Download...

 

 April 22, 2010

HierCube VCL 4.56.0

Changes...Download...

 

 July 15, 2009

Essential Pack Pro for ASP.NET 1.11.0

Changes...Download...

 

 July 15, 2009

Essential Pack for ASP.NET 1.11.0

Changes...Download...

 

 November 5, 2008

WinForms Chart 1.00.1

Changes...Download...

 

Related articles
Click to subscribe

 May 5, 2010

New Silverlight add-on for RadarCube ASP.NET

Details...

 

 March 30, 2010

Designing the Cube with the Cube Creation Wizard

Details...

 

 December 16, 2009

Creating custom Time Intelligence

Details...

 

 November 26, 2009

Creating the correct Cube structure

Details...

 

 September 30, 2009

RadarCube Request tracker

Details...

 

 August 24, 2009

Customizing the toolbox in Ria OLAP controls

Details...
More articles...
Support | Download | Purchase | Partners | Upgrade and Discount Policy | Contacts © 2005-2010 Radar-Soft, L.L.C. All rights reserved.