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

Change color of button

1 Answer 224 Views
Button
This is a migrated thread and some comments may be shown as answers.
Alan
Top achievements
Rank 1
Alan asked on 07 Jun 2012, 09:26 AM
How can I disable and change the color of a radbutton after click.

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 07 Jun 2012, 11:00 AM
Hi Alan,

Here is the sample code which I tried based on your scenario.

ASPX:
<telerik:RadButton ID="RadButton1" runat="server" AutoPostBack="true" onclick="RadButton1_Click" DisabledButtonCssClass="colored" CssClass="notdisabled" >
</telerik:RadButton>
JS:
function OnClientClicked(sender, args)
{
   sender.set_enabled(false);
}
CSS:
<style type="text/css">
.colored
 {
   background-color:Red !important;
 }  
  .RadButton_Default.rbSkinnedButton, .RadButton_Default .rbDecorated, .RadButton_Default.rbVerticalButton, .RadButton_Default.rbVerticalButton .rbDecorated, .RadButton_Default .rbSplitRight, .RadButton_Default .rbSplitLeft
  {
   background-image:none !important;
   }
   .notdisabled
     {
        border:1px solid black !important;
     }
   </style>


Hope this helps.
Thanks,
Princy.
Tags
Button
Asked by
Alan
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or