In the "How to Add" version of this thread the following block of code was posted:
What I have a is form full of fields and a dropdown list. By default a certain set of fields are handled through the input manager through the Regular Expression Text Box setting, as well as being set as required. When certain options are selected in the dropdown list, different sets of fields are required.
So what I'd like to do is if Social Security number is no longer required I'd like to set the SSN Behavior to no longer be required, or if that doesn't work, then I'd like to remove the control txtSSN from the target control list for that Input setting.
In trying to make the input no longer required I tried this:
At the stop point I verify that variable a holds the correct control name, which it does, but the final line seems to do nothing. The control still appears to be required.
In trying to remove the control from the Input Manager behavior all together I tried the following:
At the stop point I verify that variable a has the correct control name, which it does. Then I would think the final line would remove that control from the Input Manager, but if I go to that control after this executes the field is still required and the regular expression still restricts my input into that field.
Dim InputMgr As RadInputManager = New RadInputManager |
InputMgr.ID = "RadInputManager1" |
InputMgr.Skin = "Vista" |
Dim DateSetting As DateInputSetting = New DateInputSetting |
DateSetting.MinDate = New DateTime(1980, 1, 1) |
DateSetting.MaxDate = New DateTime(2020, 1, 1) |
DateSetting.ClientEvents.OnError = "onClientDateTxtError" |
DateSetting.ClientEvents.OnKeyPress = "onClientTextChanged" |
InputMgr.InputSettings.Add(DateSetting) |
TryCast(InputMgr.InputSettings(0), InputSetting).TargetControls.Add(New TargetInput(TextBox1.UniqueID, True)) |
What I have a is form full of fields and a dropdown list. By default a certain set of fields are handled through the input manager through the Regular Expression Text Box setting, as well as being set as required. When certain options are selected in the dropdown list, different sets of fields are required.
So what I'd like to do is if Social Security number is no longer required I'd like to set the SSN Behavior to no longer be required, or if that doesn't work, then I'd like to remove the control txtSSN from the target control list for that Input setting.
In trying to make the input no longer required I tried this:
Dim a As String = RadInputManager1.InputSettings(0).TargetControls.Item(0).ControlID.ToString() |
Stop |
RadInputManager1.InputSettings(0).Validation.IsRequired = False |
At the stop point I verify that variable a holds the correct control name, which it does, but the final line seems to do nothing. The control still appears to be required.
In trying to remove the control from the Input Manager behavior all together I tried the following:
Dim a As String = RadInputManager1.InputSettings(0).TargetControls.Item(0).ControlID.ToString() |
Stop |
RadInputManager1.InputSettings(0).TargetControls.RemoveAt(0) |
At the stop point I verify that variable a has the correct control name, which it does. Then I would think the final line would remove that control from the Input Manager, but if I go to that control after this executes the field is still required and the regular expression still restricts my input into that field.