New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial
ButtonToggle
The server-side ButtonToggle event occurs when a toggle button 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:
-
Button - the toggle button that has been toggled.
-
Group - the group of the clicked toggle button parent's group.
-
Index - the index of the clicked button in its containing group.
-
The following example shows how to use the properties of the event arguments:
C#
protected void RadRibbonBar1_ButtonToggle(object sender, RibbonBarButtonToggleEventArgs e)
{
string message = string.Format("ToggleButton {0} was toggled.", e.Button.Text);
string details = string.Format("Group: {0}, Index: {1}", e.Group.Text, e.Index);
textBox1.Text = string.Format("{0} {1}", message, details);
}