This is a migrated thread and some comments may be shown as answers.

Radinput controls altering the look of the textboxes

1 Answer 48 Views
Input
This is a migrated thread and some comments may be shown as answers.
Web team
Top achievements
Rank 1
Web team asked on 27 Apr 2010, 06:38 AM
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)); 
 
            } 
        } 

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 27 Apr 2010, 10:13 AM
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,
Dimo
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.
Tags
Input
Asked by
Web team
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or