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

RadInputManager with Validator Controls

5 Answers 97 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chandran Chandran
Top achievements
Rank 1
Chandran Chandran asked on 11 May 2010, 02:42 PM
Dear Telerik,
         I reviewed the help page and came to know the advantage of RadInputManager. I would like to know one information that whether it is possible to apply RadInputManager to all type of validator controls like required,compared etc ?. I have the below kind of validator code in my application;
<asp:textbox id="txtWidth" tabIndex="5" runat="server" title="(float)"  MaxLength="7" Columns="6"></asp:textbox><asp:requiredfieldvalidator id="rqux" Runat="server" Width="100%" InitialValue="" ErrorMessage=":: Required 'Width' missing or invalid." 
                                                    Display="Dynamic" ControlToValidate="txtWidth">&nbsp;<span class="warning">*</span></asp:requiredfieldvalidator><asp:regularexpressionvalidator id="rgux" Runat="server" Width="100%" ErrorMessage=":: Required 'Width' invalid (format: '0-9999.99')." 
                                                    Display="Static" ControlToValidate="txtWidth" ValidationExpression="^\d{1,4}(\.\d{1,2})?$">&nbsp;*</asp:regularexpressionvalidator> 
So how can we apply the above code with RadInputManager;

I also would like to know, if i am having 10 text boxes and two dropdowns in my EditFormTemplate. Is there any possibility to apply RadInputManger with dropdown? and also can we use one RadInputManager settings to all textboxes in EditFormTemplate? as i demonstrated below;
<telerik:RadInputManager ID="RadInputManager1" runat="server" Skin="Office2007">  
                    <telerik:TextBoxSetting BehaviorID="TextBoxBehavior1" InitializeOnClient="false">  
                        <TargetControls> 
                            <telerik:TargetInput ControlID="txt1" /> 
                        </TargetControls> 
                        <TargetControls> 
                            <telerik:TargetInput ControlID="txt2" /> 
                        </TargetControls> 
                        <TargetControls> 
                            <telerik:TargetInput ControlID="txt3" /> 
                        </TargetControls> 
                    </telerik:TextBoxSetting> 

I came over all help topics related to RadInputManager, but no one gave adequate information related to above mentioned scenarios. So please do the favourable to know the ideas.

Regards,
Chandran

5 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 13 May 2010, 11:17 AM
Hi Chandran,

I suggest you to take this online demo of RadGrid as a starting point for your implementation:

http://demos.telerik.com/aspnet-ajax/input/examples/radinputmanager/dynamicinputfiltersettings/defaultcs.aspx?product=grid

It illustrates how to apply different validation rules for the grid edit form editors based on their data type. Note that you can specify IsRequired = true for some of the input manager settings in order to make a particular field in the edit form required.

However, I am afraid we do not have such extender for DropDown.

Sincerely yours,
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
Chandran Chandran
Top achievements
Rank 1
answered on 13 May 2010, 12:23 PM

Hello Maria,

I am already aware of your above mentioned help link. I came to know that the RegularExpression related validator alone only mentioned with RegExpTextBoxSetting not other validators like Compare,Range validator and so on. How can i do the declarations with them.

I already pointed, whether is it possible to give only one TextBoxSetting InputManager for all of the textbox controls inside the EditFormTemplate.

 

I hope my question is understandable, if so please let me know the possibilities.

 

Regards,

Chandran

 

0
Maria Ilieva
Telerik team
answered on 14 May 2010, 12:13 PM
Hello,

If you need to add RequiredFiedValidation you could add one setting with multiple target controls.
For example:
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
            <br />
            <asp:TextBox  ID="TextBox1" runat="server"></asp:TextBox>
            <br />
            <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
            <br />    
     
        <telerik:RadInputManager ID="RadInputManager1" runat="server">
            <telerik:TextBoxSetting BehaviorID="Setting1" EmptyMessage="EmptyMessage55">
                <TargetControls>
                    <telerik:TargetInput ControlID="TextBox1" />
                </TargetControls>
            </telerik:TextBoxSetting>
            <telerik:NumericTextBoxSetting Type="Currency" BehaviorID="Setting2">
                <TargetControls>
                    <telerik:TargetInput ControlID="TextBox2" Enabled="true" />
                </TargetControls>
            </telerik:NumericTextBoxSetting>
            
        </telerik:RadInputManager>

However if you need to use other validation one more setting for it should be added. 

<asp:Repeater ID="Repeater1" runat="server">
                <ItemTemplate>
                    <br />
                    Internet e-mail address:
                    <asp:TextBox ID="TextBox1" Text="e-mail@goes.here"  runat="server"></asp:TextBox>               
                </ItemTemplate>
            </asp:Repeater>
            <telerik:RadInputManager ID="RadInputManager1" runat="server">      
            <telerik:RegExpTextBoxSetting EmptyMessage="EmptyMessage" BehaviorID="Setting3"
            ValidationExpression="^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$" ErrorMessage="ErrorMessage">
                <TargetControls>
                    <telerik:TargetInput ControlID="Repeater1" />
                </TargetControls>
            </telerik:RegExpTextBoxSetting>          
           </telerik:RadInputManager>


Kind regards,
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
Chandran Chandran
Top achievements
Rank 1
answered on 14 May 2010, 01:35 PM
Hello Maria,

Still i am not clear about with how to set CompareValidator and RangeValidator with RadInputManager.
Also i have one more question can we apply all of the textbox controls with one RadInputSettings.

I hope now you could understand my need. It would be very easier, if it is demostrated with some sample of code


-Thanks
0
Accepted
Maria Ilieva
Telerik team
answered on 17 May 2010, 09:35 AM
Hi Chandran,

You could set CompareValidator to the target inputs in RadInputManager like this:
<asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="RadTextBox1"    
       ControlToCompare="RadTextBox2" ErrorMessage="!" Type="Double" Operator="GreaterThanEqual">  
</asp:CompareValidator>  
  
        <telerik:RadTextBox ID="RadTextBox1" runat="server">
        </telerik:RadTextBox>
        <telerik:RadTextBox ID="RadTextBox2" runat="server">
        </telerik:RadTextBox>
          
        <telerik:RadInputManager ID="RadInputManager1" runat="server">
        <telerik:TextBoxSetting>
        <TargetControls>
        <telerik:TargetInput ControlID="RadTextBox1" />
        <telerik:TargetInput ControlID="RadTextBox2" />
        </TargetControls>
        </telerik:TextBoxSetting>
        </telerik:RadInputManager>

Regarding the second question you asked, as I already mentioned you could set as many text boxes as you want to be target controls in one RadInputManager setting.


Kind regards,
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
Grid
Asked by
Chandran Chandran
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Chandran Chandran
Top achievements
Rank 1
Share this question
or