Changing the back ground Color of Button

6 posts, 0 answers
  1. A2H
    A2H avatar
    177 posts
    Member since:
    Mar 2010

    Posted 21 Nov 2012 Link to this post

    Hi,

    I want to change the background color of Rad Button.I want to achieve this through code with out changing or creating any customized skins.

    My requirement is to give button back ground as Green color.
    Unfortunately Forest "skin" doesn't match with my design and when I applied "Hay" skin button is appearing in light green color.

    I want to give solid green back ground to my Rad button.

    Please help me its very urgent.

    Thanks,
    A2H
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 21 Nov 2012 Link to this post

    Hi,

    With reference to this forum thread it is not possible to set different color. One suggestion is that you can use ButtonType="LinkButton" and can set the BackColor of the RadButton as follows.

    ASPX:
    <telerik:RadButton ID="RadButton1" ButtonType="LinkButton" Text="Button" runat="server">
    </telerik:RadButton>

    C#:
    RadButton1.BackColor = System.Drawing.Color.Green;

    Hope this helps.

    Regards,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Elliott
    Elliott avatar
    391 posts
    Member since:
    May 2010

    Posted 20 Dec 2012 Link to this post

    I thought you had to do it this way
    ((FillPrimitive)radButton1.ButtonElement.GetChildrenByType(typeof(FillPrimitive))[0]).GradientStyle = Telerik.WinControls.GradientStyles.Solid;
  5. Slav
    Admin
    Slav avatar
    1355 posts

    Posted 21 Dec 2012 Link to this post

    Hi Marianne,

    It appears that you are referring to the RadControls for WinForms. This forum thread is related to the RadButton control, which is a part of the RadControls for ASP.NET AJAX suite.

    Kind regards,
    Slav
    the Telerik team
    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 their blog feed now.
  6. Elliott
    Elliott avatar
    391 posts
    Member since:
    May 2010

    Posted 24 Dec 2012 Link to this post

    you are correct
  7. A2H
    A2H avatar
    177 posts
    Member since:
    Mar 2010

    Posted 22 Jan 2013 Link to this post

    Hi All,

    Thanks For your help.

    I have acheived it by creating a Custom Skin for the button.

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