New to Telerik UI for ASP.NET AJAX? Start a 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:
-
The RadRibbonBar which has fired the event. This argument is of type object, but can be cast to the RadRibbonBar type.
-
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:
C#
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);
}