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

Remove styles on RadButton

6 Answers 529 Views
Button
This is a migrated thread and some comments may be shown as answers.
Nicolas
Top achievements
Rank 1
Nicolas asked on 14 Apr 2014, 07:01 AM
Hi,

I'm trying to remove styles on RadButton as said in this topic: http://www.telerik.com/forums/remove-styles-radlinkbutton
However, this doesn't work at all, I keep getting default style on IE 8 or Firefox (by removing class with firebug or IE dev toolbar, I get the good result).

Here is my code:
<telerik:RadButton ID="RadButtonValidate" runat="server" Text="Valider" ButtonType="StandardButton" EnableEmbeddedSkins="false" EnableEmbeddedBaseStylesheet="false" EnableBrowserButtonStyle="false" EnableTheming="false" EnableAjaxSkinRendering="false" />


I use Telerik ASP.NET version 2014.1.225.45.
Can you help me ?

6 Answers, 1 is accepted

Sort by
0
Accepted
Danail Vasilev
Telerik team
answered on 15 Apr 2014, 01:25 PM
Hi Nicolas,

You can simply set the EnableBrowserButtonStyle property to true. For example:
ASPX:
<telerik:RadButton ID="RadButtonValidate" runat="server" Text="Valider" ButtonType="StandardButton" EnableBrowserButtonStyle="true" />


Regards,
Danail Vasilev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Nicolas
Top achievements
Rank 1
answered on 18 Apr 2014, 09:42 AM
Hi,

Thanks, it works perfectly !
0
Michael
Top achievements
Rank 1
answered on 02 Aug 2015, 03:36 PM

Doesn't work for me at all :(

I am using the latest version of Telerik for ASP.Net AJAX 

 <telerik:RadButton ID="teamPulseLogin" runat="server" ButtonType="StandardButton" EnableAjaxSkinRendering="false" EnableTheming="false" EnableBrowserButtonStyle="true" EnableEmbeddedBaseStylesheet="false" EnableEmbeddedSkins="false" CssClass="btn btn-info" OnClick="teamPulseLogin_Click">
                        </telerik:RadButton>

I cleared the browser cache but still I see the Telerik css classes assigned when ispecting the element. Also the styles are applied and my own are not.

Any ideas?

0
Joana
Telerik team
answered on 05 Aug 2015, 01:22 PM
Hi Michael,

The EnableBrowserButtonStyle apply the default browser styling to the RadButton. However, the control is rendered with particular classes which are not removed by setting the EnableBrowserStyle property.

You could remove the CssClasses manually OnClientLoad of the RadButton:

<script>
    function OnClientLoad(sender, args) {
        sender.removeCssClass('RadButton');
    }
</script>
<telerik:RadButton ID="RadButton1" OnClientLoad="OnClientLoad">
</telerik:RadButton>

Another option is to create a custom skin, following the approach from the Creating a Custom Skin for RadButton article and override the styles of the base and skin specific stylesheets.

There is no reason for not applying your custom styles. You could test whether your styles are applied to a HTML element.

<input type="submit" value="Test" id="teamPulseLogin_input" name="teamPulseLogin" class="btn">

If the issue is with the RadButton control
could you please send us a sample code how to reproduce it.

Regards,
Joana
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Michael
Top achievements
Rank 1
answered on 21 Aug 2015, 12:15 PM

Thanks. Yes there is no reason to not apply my own css classes and that is exactly what I wanted to do :)

The problem is that the RadButton styles are overwriting my styles...

 

I think removing the css class the js way is always just a workaround. I would appreciate to control this by a property instead of letting the css class being applied and then removing it.

 

0
Danail Vasilev
Telerik team
answered on 26 Aug 2015, 07:53 AM
Hi Michael,

Can you send me a runnable sample that reproduces the issue with the styles not applied, so that I can investigate it further?

As for the classes removal feature you can use our feedback portal in order to log your ideas about the control http://feedback.telerik.com/Project/108

Regards,
Danail Vasilev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Button
Asked by
Nicolas
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
Nicolas
Top achievements
Rank 1
Michael
Top achievements
Rank 1
Joana
Telerik team
Share this question
or