change background

2 posts, 0 answers
  1. Dawson
    Dawson avatar
    45 posts
    Member since:
    Sep 2013

    Posted 18 Jun 2014 Link to this post

    I have a scenario.. How can i change the background color of a radcombox with change in selected item from client side.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 18 Jun 2014 in reply to Dawson Link to this post

    Hi Dawson,

    Try the following code to achieve your scenario.


    <telerik:RadComboBox runat="server" id="RadComboBox1" OnClientSelectedIndexChanged="OnClientSelectedIndexChanged" >
                    <telerik:RadComboBoxItem Text="red" Value="red" />
                    <telerik:RadComboBoxItem Text="blue" Value="blue" />
                    <telerik:RadComboBoxItem Text="green" Value="green" />
                    <telerik:RadComboBoxItem Text="yellow" Value="yellow" />


    function OnClientSelectedIndexChanged(sender, args)
                sender.get_inputDomElement().style.backgroundColor = args.get_item().get_value();

Back to Top