Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

Set Style From Code Behind

$
0
0
Hi Ryan,

If you debug the ValueChanged function, you can see that the "sender" is TextBox object, not Input object. So the CSS selector will be .RadInput .riTextBox.custom3 {}.

The other approach is to set the class name in a similar way as in the first solution:
function ValueChanged(sender, eventArgs)
{
    var inputElement = sender.get_element();
    inputElement.className += inputElement.className + " custom";
}

Please, keep in mind, that if you do not use jQuery "addClass()", it is necessary to do verification if the class has not already been added. Otherwise the class will be added every time when the ValueChanged function is fired.

Regards,
Magdalena
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 

Viewing all articles
Browse latest Browse all 94857

Latest Images

Trending Articles



Latest Images