Set a wrapper css class

3 posts, 0 answers
  1. Steve
    Steve avatar
    1888 posts
    Member since:
    Dec 2008

    Posted 15 Nov 2011 Link to this post

    If I inherit from the RadTextBox (to make my own server control), how can I specify a new class on the root "RadInput RadInput_Default" level?

    this.CssClass seems to style just the input control.
  2. Jayesh Goyani
    Jayesh Goyani avatar
    2733 posts
    Member since:
    May 2010

    Posted 17 Nov 2011 Link to this post


    You can achieve this thing by using jQuery.

    <script type="text/javascript">
            $(document).ready(function () {
                $('span[class$="RadInput RadInput_Default"]').addClass("MyCss");
    <style type="text/css">
                background-color: Red;

    Note : Don't forget to add jQuery reference in Head tag.
    Please check final-output image.

    Sorry, for result image. by mistake it was added by me.

    Jayesh Goyani
  3. Galin
    Galin avatar
    526 posts

    Posted 18 Nov 2011 Link to this post

    Hi Jayesh Goyani,

    The suggestion of Jayesh Goyani works well, however you can also use our new property WrapperCssClass, which sets a CssClass on the root level and is added in version Q3 2011.

    I hope this helps.

    Kind regards,
    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
Back to Top