ToggleButton - Right-to-Left Support

Isolate this demo as a stand-alone application
  • About this demo
  • C#
  • VB

RadToggleButton can be placed in a right-to-left environment without issues in its appearance or functionality.

In order to switch a RadToggleButton to RTL mode, you should set dir=rtl to its parent HTML element or use the direction:rtl CSS property. You can also do this globally for the page, e.g., on the <body>, <form> or <html> element.

  • DefaultCS.aspx
<%@ Page Language="C#" AutoEventWireup="true"  %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <div class="demo-container size-thin" style="direction: rtl; text-align: center;">
        <telerik:RadToggleButton ID="RadToggleButton1" runat="server" AutoPostBack="false">
            <ToggleStates>
                <telerik:ButtonToggleState Text="موافق">
                    <Icon CssClass="rbOk" />
                </telerik:ButtonToggleState>
                <telerik:ButtonToggleState Text="إلغاء">
                    <Icon CssClass="rbCancel" />
                </telerik:ButtonToggleState>
            </ToggleStates>
        </telerik:RadToggleButton>
    </div>
    </form>
</body>
</html>

Find Assistance

Help Us Improve

Was this example helpful?