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

Maintaining textbox pixel width with RadInputManager

4 Answers 130 Views
Input
This is a migrated thread and some comments may be shown as answers.
Kevin Cabritit
Top achievements
Rank 1
Kevin Cabritit asked on 13 Apr 2010, 08:43 AM
I am attempting to use the RadInputManager on a form. This form consists of about 10 regular textboxes and a RadInputManager.

Some of the textboxes are larger than others. They have been applied a particular css style, either 'form25' or 'form50', which define a width in pixels.

When rendering the page, RadInputManager converts the textboxes and the style is replaced, making all textboxes the same width.

I have attempted to override the style using 'html body form .RadInputMgr_Simple .form50' as the css tag, but am not having any luck. I have read the blog post regarding overriding styles and specificity, but am unable to get this working.

Please tell me how I can go about doing this. There are hundreds of textbox controls through this site and I'd like to maintain their width while taking advantage of the RadInputManager functionality.

Thanks.

4 Answers, 1 is accepted

Sort by
0
Kevin Cabritit
Top achievements
Rank 1
answered on 15 Apr 2010, 01:31 PM
*bump*

Can anyone help?
0
Maria Ilieva
Telerik team
answered on 15 Apr 2010, 02:28 PM
Hello Alex,

Thank you for contacting us and for your question.

 Possible solution for your issue could be to set css class for a particular TextBox setting in the RadInputManager settings and not in the TextBox directly.  RadInputManager settings contain the necessary css properties which could be used ( DisabledCssClass, EmptyMessageCssClass, EnabledCssClass, FocusedCssClass, HoveredCssClass, ReadOnlyCssClass).

Let us know if this helps and if further assistance is needed.

Best wishes,
Maria Ilieva
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.
0
Kevin Cabritit
Top achievements
Rank 1
answered on 15 Apr 2010, 02:46 PM
Thanks for the reply.

I have experimented with using these CSS tags, however to implement these retroactively will take forever.

Take this for example:
                                            <telerik:RadInputManager ID="RadInputManager1" runat="server"
                                                <telerik:TextBoxSetting Validation-IsRequired="True" BehaviorID="RequiredFields"
                                                    <TargetControls> 
                                                        <telerik:TargetInput ControlID="Password" /> 
                                                        <telerik:TargetInput ControlID="UserName" /> 
                                                        <telerik:TargetInput ControlID="ConfirmPassword" /> 
                                                        <telerik:TargetInput ControlID="Address1" /> 
                                                        <telerik:TargetInput ControlID="Email" /> 
                                                        <telerik:TargetInput ControlID="City" /> 
                                                        <telerik:TargetInput ControlID="PostCode" /> 
                                                        <telerik:TargetInput ControlID="State" /> 
                                                        <telerik:TargetInput ControlID="PhoneNumber" /> 
                                                        <telerik:TargetInput ControlID="Answer" /> 
                                                        <telerik:TargetInput ControlID="Name" /> 
                                                    </TargetControls> 
                                                    <Validation IsRequired="True" /> 
                                                </telerik:TextBoxSetting> 
                                                <telerik:TextBoxSetting Validation-IsRequired="False" BehaviorID="NotRequiredFields"
                                                    <TargetControls> 
                                                        <telerik:TargetInput ControlID="Address2" /> 
                                                    </TargetControls> 
                                                </telerik:TextBoxSetting> 
                                            </telerik:RadInputManager> 

There's a few textbox fields here, some are small, some are large.

Right now, all I need to do is to define which are required fields and which are not.

To implement CSS tags would result in 4 times the amount of configuration here.

Surely there's a way to override with a global css change?
0
Maria Ilieva
Telerik team
answered on 19 Apr 2010, 12:20 PM
Hello Alex,

Currently the best option for your scenario could be to define particular width to a container which contains several text boxes. In this way it will not be necessary to define this setting for each input control. For example:

<%@ Page Language="C#" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  
<head runat="server">
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<title>RadControls</title>
<style type="text/css">
  
.width50 .RadInputMgr
{
      width:50px;
}
  
.width150 .RadInputMgr
{
      width:150px;
}
  
</style>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
  
<telerik:RadInputManager ID="RadInputManager1" runat="server">
      <telerik:TextBoxSetting>
            <TargetControls>
                  <telerik:TargetInput ControlID="TextBox1" />
                  <telerik:TargetInput ControlID="TextBox2" />
            </TargetControls>
      </telerik:TextBoxSetting>
</telerik:RadInputManager>
  
<span class="width50">
      <asp:TextBox ID="TextBox1" runat="server" />
</span>
  
<span class="width150">
      <asp:TextBox ID="TextBox2" runat="server" />
</span>
  
</form>
</body>
</html>


Let us know if this helps.

All the best,
Maria Ilieva
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
Kevin Cabritit
Top achievements
Rank 1
Answers by
Kevin Cabritit
Top achievements
Rank 1
Maria Ilieva
Telerik team
Share this question
or