Radinput controls altering the look of the textboxes

2 posts, 0 answers
  1. Web team
    Web team avatar
    57 posts
    Member since:
    Mar 2010

    Posted 27 Apr 2010 Link to this post

    When I assigned validation using RadInput inside  a grid dynamically, it changes the size and remove the rounded corners of the textboxes. please see attach image (look on Customer, WebSite and Profile Link field)

    Here's the code:
    protected void grdCustomer_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e) 
                if (e.Item is GridEditableItem && e.Item.IsInEditMode) 
                    string strURL = @"^(http\:\/\/|[a-zA-Z0-9_\-]+(?:\.[a-zA-Z0-9_\-]+)*\.[a-zA-Z]{2,4}(?:\/[a-zA-Z0-9_]+)*(?:\/[a-zA-Z0-9_]+\.[a-zA-Z]{2,4}(?:\?[a-zA-Z0-9_]+\=[a-zA-Z0-9_]+)?)?(?:\&[a-zA-Z0-9_]+\=[a-zA-Z0-9_]+)*)$"
                    GridEditableItem item = e.Item as GridEditableItem; 
                    TextBox txtName = (TextBox)item["CustomerName"].Controls[0]; 
                    TextBox txtProfile = (TextBox)item["ProfileLink"].Controls[0]; 
                    TextBox txtWebsite = (TextBox)item["Website"].Controls[0]; 
                    TextBoxSetting riReq = (TextBoxSetting)riManager.GetSettingByBehaviorID("riReq"); 
                    riReq.ErrorMessage = "Required field"
                    riReq.TargetControls.Add(new TargetInput(txtName.UniqueID, true)); 
                    RegExpTextBoxSetting riURL = (RegExpTextBoxSetting)riManager.GetSettingByBehaviorID("riURL"); 
                    riURL.ErrorMessage = "Invalid URL"
                    riURL.ValidationExpression = strURL; 
                    riURL.TargetControls.Add(new TargetInput(txtProfile.UniqueID, true)); 
                    riURL.TargetControls.Add(new TargetInput(txtWebsite.UniqueID, true)); 
  2. Dimo
    Dimo avatar
    8486 posts

    Posted 27 Apr 2010 Link to this post

    Hi Arnold,

    In order to keep the rounded corners, you can set Skin="" and EnableEmbeddedBaseStyleSheet="false" to the RadInputManager. However, by doing this, you will lose the error state of the textboxes. The textboxes can be styled either by RadFormDecorator or by RadInputManager, but not both.

    RadFormDecorator only styles textboxes, which have no CSS class. That's why you need to completely disable the RadInputManager skinning in your case, so that the textboxes do not receive CSS classes.

    Best wishes,
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top