New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

ToggleListToggle

The server-side ToggleListToggle event occurs when a ToggleButton inside a ToggleList is toggled, causing a postback.

The event handler function receives two arguments:

  1. The RadRibbonBar which has fired the event. This argument is of type object, but can be cast to the RadRibbonBar type.

  2. An EventArgs object with the following properties:

    • ToggleButton - the ToggleButton that has been toggled.

    • ToggleList - the parent toggle list of the clicked toggle button.

    • ToggleListButtons - a collection of all toggle button in the parent toggle list.

    • Group - the parent group of the clicked toggle button.

    • Index - the index of the clicked toggle button in its containing toggle list.

The following example shows how to use the properties of the event arguments:


protected void RadRibbonBar1_ToggleListToggle(object sender, RibbonBarToggleListToggleEventArgs e)
{
    string message = string.Format("ToggleList's ToggleButton {0} was toggled.", e.ToggleButton.Text);
    string details = string.Format("Group: {0}, Index: {1}", e.Group.Text, e.Index);

    textBox1.Text = string.Format("{0} {1}", message, details);
}


Protected Sub RadRibbonBar1_ToggleListToggle(ByVal sender As Object, ByVal e As RibbonBarToggleListToggleEventArgs)
    Dim message As String = String.Format("ToggleList's ToggleButton {0} was toggled.", e.ToggleButton.Text)
    Dim details As String = String.Format("Group: {0}, Index: {1}", e.Group.Text, e.Index)

    textBox1.Text = String.Format("{0} {1}", message, details)
End Sub

See Also

In this article