Remove styles on RadButton

7 posts, 1 answers
  1. Nicolas
    Nicolas avatar
    5 posts
    Member since:
    Apr 2014

    Posted 14 Apr 2014 Link to this post

    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 ?
  2. Answer
    Danail Vasilev
    Admin
    Danail Vasilev avatar
    1490 posts

    Posted 15 Apr 2014 Link to this post

    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.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Nicolas
    Nicolas avatar
    5 posts
    Member since:
    Apr 2014

    Posted 18 Apr 2014 Link to this post

    Hi,

    Thanks, it works perfectly !
  5. Michael
    Michael avatar
    17 posts
    Member since:
    Jan 2014

    Posted 02 Aug 2015 Link to this post

    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?

  6. Joana
    Admin
    Joana avatar
    70 posts

    Posted 05 Aug 2015 Link to this post

    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
  7. Michael
    Michael avatar
    17 posts
    Member since:
    Jan 2014

    Posted 21 Aug 2015 in reply to Joana Link to this post

    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.

     

  8. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1490 posts

    Posted 26 Aug 2015 Link to this post

    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017