Change button style on click.

2 posts, 1 answers
  1. Ivy
    Ivy avatar
    30 posts
    Member since:
    Feb 2013

    Posted 04 Mar 2013 Link to this post

    Hi,

    Is it possible to change the style of the RadToolBar button once it is clicked?

    Thank you,
    Ivy.
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 04 Mar 2013 Link to this post

    Hello,

    Yes, it is possible to change the item style when the mouse button is pressed using the ClickedCssClass property. Please have a look at the following code in which the style of the button is changed when it is clicked.

    ASPX:
    <telerik:RadToolBar ID="RadToolBar1" runat="server">
        <Items>
            <telerik:RadToolBarDropDown runat="server" Text="File">
                <Buttons>
                    <telerik:RadToolBarButton runat="server" Text="New" ClickedCssClass="CustomClickedItem">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton runat="server" Text="Open">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton runat="server" Text="Exit">
                    </telerik:RadToolBarButton>
                </Buttons>
            </telerik:RadToolBarDropDown>
        </Items>
    </telerik:RadToolBar>

    CSS:
    <style type="text/css">
        .CustomClickedItem .rtbText
        {
            font-style: italic !important;
            color: Red !important;
        }
    </style>

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top