This is a migrated thread and some comments may be shown as answers.

creating stand alone bold/italic setting buttons

1 Answer 127 Views
Button
This is a migrated thread and some comments may be shown as answers.
Kjell
Top achievements
Rank 1
Kjell asked on 07 Aug 2013, 11:13 PM
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? 

1 Answer, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 12 Aug 2013, 07:42 PM
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.
Tags
Button
Asked by
Kjell
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
Share this question
or