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

RadInputManager - IsRequired

2 Answers 89 Views
Input
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 14 Jul 2010, 07:50 PM
Good afternoon,
I am trying to set a textbox as required using the RadInputManager.  My problem is that I need to be able to do this dynamically in the code-behind (C#).  Here is my scenario:  The web form has 4 textboxes.  Depending on the user type, one or more of the textboxes are required and the rest are not required.  Listed below is my RadInputManager code.  Any assistance would be greatly appreciated.

<

 

telerik:RadInputManager ID="rimManager" runat="server" EnableEmbeddedSkins="False">

 

 

 

<telerik:NumericTextBoxSetting BehaviorID="Numeric" Type="Number" ErrorMessage="Invalid" DecimalDigits="0" MinValue="0">

 

 

 

<TargetControls>

 

 

 

<telerik:TargetInput ControlID="tbOne" />

 

 

 

<telerik:TargetInput ControlID="tbTwo" />

 

 

 

<telerik:TargetInput ControlID="tbThree" />

 

 

 

<telerik:TargetInput ControlID="tbFour" />

 

 

 

</TargetControls>

 

 

 

</telerik:NumericTextBoxSetting>

 

 

</

 

telerik:RadInputManager>

 

 

 

 

 

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 15 Jul 2010, 10:30 AM
Hello Jeff,


Hope the following sample code will help you in adding the TextBoxSetting from server side.


C#:
  RadInputManager1.InputSettings.Clear();
  TextBoxSetting setting = new TextBoxSetting();
  setting.Validation.IsRequired = true;
  TargetInput input = new TargetInput("TextBox2", true);
  setting.TargetControls.Add(input);
  RadInputManager1.InputSettings.Add(setting);


-Shinu.
0
Jeff
Top achievements
Rank 1
answered on 15 Jul 2010, 07:30 PM
Shinu,
Thank you so much... it works like a charm!

Jeff
Tags
Input
Asked by
Jeff
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Jeff
Top achievements
Rank 1
Share this question
or