creating stand alone bold/italic setting buttons

2 posts, 0 answers
  1. Kjell
    Kjell avatar
    276 posts
    Member since:
    Jun 2010

    Posted 07 Aug 2013 Link to this post

    I have a form where a user can specify the font/style/size of some text which is not present on the same page.

    I need to add a couple toggle buttons which are basically the same Bold/Italic buttons which appear in many telerik controls, but just by themselves.  I'm wondering what would be the easiest way to do this. 

    I was thinking of just creating a plain button and setting the regular state style to the pressed style when it is clicked.  Does that make sense? 
  2. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1492 posts

    Posted 12 Aug 2013 Link to this post

    Hi Kjell,

    You can use the CssClass property exposed by the RadButtonToggleStates, in order to set particular styles for each of the ToggleStates. For example:
    <style type="text/css">
        .notClicked {
            font-weight:bold;
            font-size:x-small !important;
        }
        .clicked {
            font-weight:normal;
            font-size:medium !important;
        }
    </style>
    ASPX:
    <telerik:RadButton ID="RadButton1" runat="server" ButtonType="ToggleButton" ToggleType="CheckBox" Checked="true">
        <ToggleStates>
            <telerik:RadButtonToggleState Text="not clicked" CssClass="notClicked"  />
            <telerik:RadButtonToggleState Text="is clicked" Selected="true" CssClass="clicked" />
        </ToggleStates>
    </telerik:RadButton>



    Regards,
    Danail Vasilev
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top