RadToolBar for ASP.NET

Client-Side Object Model Send comments on this topic.
Telerik RadToolBar Client-Side > Client-Side Object Model

Glossary Item Box

Telerik RadToolBar exposes rich and flexible client-side API which provides a set of objects, properties, methods and events.

Getting the client-side Telerik RadToolBar instance

You can get the client-side object instance of Telerik RadToolBar using its ClientID, e.g. for toolbar instance with ID="RadToolBar1":

  Copy Code
<rad:radtoolbar runat="server" ID="RadToolBar1" ... />

you can get the instance using the following javascript:

  Copy Code
<script language="javascript">
var radToolBar1 = <%= RadToolBar1.ClientID %>;
alert(radToolBar1.Skin);
</script>

RadToolBar object

Properties

Once you have gotten the client-side object instance, you can use various properties/methods.

Property

Description

AutoPostBack

Can be used to override the AutoPostBack server-side property on the client.

ButtonCommandArray

An array of all commands.

ButtonIDArray

An array of all button element IDs.

IsToggle

Indicates wether the button is a toggle button. Works on all buttons.

NumberOfButtons

The number of buttons on the toolbar.

Orientation

Informs about current orientation.

Do not change! Use MakeVertical/MakeHorizontal to define the toolbar orientation.

SeparatorIDArray

An array of separator element IDs.

Skin

Gets the skin in use. Cannot be used to change skin on client - the latter is not supported.

Toggled

Indicates wether the toggle button is toggled.

Works on toggle buttons only.

UseFadeEffect

Sets/gets wether to use fade effect on buttons.



Methods

Method

Description

EnableButton(text); DisableButton(text);

Enables/disables the button which command name is given to the method.

GetButtonByCommand(ButtonCommandName);

Returns an instance of a button with a specified command.

HideButton(text); ShowButton(text);

Hides/shows the button which command name is given to the method.

MakeVertical();

Determines vertical orientation of the toolbar.

MakeHorizontal();

Determines horizontal orientation of the toolbar.

ToggleONButton(text); ToggleOFFButton(text);

Toggles on/off the button which command name is given to the method.

 

RadToolBarButton object

Properties

Property

Description

AccessKey

Use this property to get/set the shortcut key of the button.

CommandName

Gets the command name of the button.

Enabled, Visible

Use these two properties to get the status of the button.

If you want to to change the state of the button use the Show/Hide and Enable/Disable API.