Dynamic style attribute

2 posts, 0 answers
  1. Sami
    Sami avatar
    2 posts
    Member since:
    Jan 2015

    Posted 26 Apr 2015 Link to this post

    Dear,

    How to apply dynamic style attribute written by user (who is familiar with css) for dynamic Telerik controls?

    Like:

    RadTextBox1..Attributes.Add("style", "width:100%");

     

    Thanking you,

  2. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 29 Apr 2015 Link to this post

    Hello,

    In order to set 100% width for the textbox you need to override the control's inline width style with CSS rules using the !important clause as shown below:
    RadTextBox1.WrapperCssClass = "CustomClass";
    <style type="text/css">
               .CustomClass
               {
                   width: 100% !important;
               }
           </style>

    Regards,
    Pavlina
    Telerik
     

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

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top