Search
English
Customizing the OLAP toolbox

Among the RadarCube components there's a Toolbox control that provides a user an easy access to such often-used functions as save/restore the Grid, export, or hide certain Grid areas…

But you can expand the functionality of this control either by overriding the on-click actions of the standard toolbox buttons or by adding new buttons to the Toolbox. Let's see how we can do that.

Overriding the on-click actions of the standard toolbox buttons

For overriding the standard on-click actions you should handle the TOLAPToolbox.ToolboxItemAction event.

The handler of this event is called right before performing the standard action. The parameter of the ToolboxItemActionArgs type, passed to the event, contains all the information for processing the user's action. You can read more about that in the descriptions of the Toolbox button classes.

In the event handler, you can define what button is pressed by examining the e.Item property, and prevent fulfilling of the standard action by setting the e.Handled flag to True.

For example, let's override the standard on-click action of the Save button. The default on-click action is saving the current state of the Grid and sending it to the user in a XML file. We'll make it save the current Grid state to the database:

protected void TOLAPToolbox1_ToolboxItemAction(object sender, ToolboxItemActionArgs e)
{
    if (e.Item is TSaveLayoutToolboxButton)
    {
        string xmlstring = TOLAPGrid1.Serializer.XMLString;
        // save the string to the database
        e.Handled = true;
    }
}

Adding new buttons to the Toolbox

To add a button to the Toolbox you just need to put an appropriate object to the TOLAPToolbox.CustomButtons collection. You can do it either programmatically (in the Page_Init event handler, not later!) or in DesignTime.

When you create a user button instance programmatically, mind that the ButtonID property value should be unique for each button and remain unchanged from session to session. In general, each of the user’s buttons, added to the Toolbox, should have a unique value of the ButtonID property, by which it can be identified in the TOLAPToolbox.ToolboxItemAction event handler.

In addition to the ButtonID and such self-explanatory properties as Image and Tooltip, each button has a very important HandlingType property that defines the way of processing the action of pressing the button. There are three possible ways to process the pressing of a Toolbox button:

  1. Postback-processing on the server.
  2. Callback-processing on the server.
  3. Firing a client script.

For processing the pressing of the button, you need to write a TOLAPToolbox.ToolboxItemAction event handler:

protected void TOLAPToolbox1_ToolboxItemAction(object sender, ToolboxItemActionArgs e)
{
if ((e.Item is TCustomToolboxButton) && (e.Item.ButtonID == "9b5c8c64-84ed-49cd-aa0f-795f711f1f07"))
    {
        // do some action
    }
}

In case when the pressing of the button is processed on the client, the client script should be defined in the ClientScript property of the button. For example, MyButton.ClientScript = "alert('a')";

Related links

Download Radar-Soft products


Buy Radar-Soft products


Visit our support site


Latest versions
Click to subscribe

 June 26, 2009

RadarCube VCL 1.12.0

Changes...Download...

 

 June 21, 2009

Essential Pack Pro for ASP.NET 1.10.0

Changes...Download...

 

 June 21, 2009

Essential Pack for ASP.NET 1.10.0

Changes...Download...

 

 June 9, 2009

RadarCube ASP.NET 2.20.3

Changes...Download...

 

 June 8, 2009

RadarCube WinForms MSAS 2.10.1

Changes...Download...

 

 June 8, 2009

RadarCube WinForms Desktop 2.10.1

Changes...Download...

 

 April 28, 2009

HierCube VCL 4.51.0

Changes...Download...

 

 November 5, 2008

WinForms Chart 1.00.1

Changes...Download...

 

Related articles
Click to subscribe

 June 29, 2009

Templating columns for Essential Pack Grid

Details...

 

 June 3, 2009

Customizing RadarCube for ASP.NET

Details...

 

 May 8, 2009

Hierarchy members' attributes

Details...

 

 February 10, 2009

Initialization of the OLAP-slice view

Details...

 

 January 28, 2009

Styling RIA OLAP controls

Details...

 

 December 24, 2008

Custom menus in RIA controls

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