All,
I currently have controls inside of a custom template that need to pass a strict validation process. For instance, there are two datetime pickers within the Template whose values need to be passed to a custom validation function. The problem that I am getting is how to pass those values to say the following customvalidator servervalidate routine. I seem to only be able to reference the items in one of the radgrid commands as shown below:
I need to be able to reference these values in the custom validator event as shown below:
Is it possible to reference these values outside of one of the radgrid events because a standard validation and custom validation will not fit my needs. Any help will be greatly appreciated.
Thanks,
Jonathan Adkins
I currently have controls inside of a custom template that need to pass a strict validation process. For instance, there are two datetime pickers within the Template whose values need to be passed to a custom validation function. The problem that I am getting is how to pass those values to say the following customvalidator servervalidate routine. I seem to only be able to reference the items in one of the radgrid commands as shown below:
| Protected Sub RadGrid2_UpdateCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid2.UpdateCommand |
| If TypeOf e.Item Is GridEditableItem Then |
| Dim editedItem As GridEditFormItem = CType(e.Item, GridEditFormItem) |
| Dim StartTime As RadDateTimePicker = CType(editedItem.FindControl("RadDateTimePickerStart"), RadDateTimePicker) |
| Dim EndTime As RadDateTimePicker = CType(editedItem.FindControl("RadDateTimePickerEnd"), RadDateTimePicker) |
| Dim LeaveType As RadComboBox = CType(editedItem.FindControl("drpleavetype"), RadComboBox) |
| Dim LeaveRequest_Fkey As Label = CType(editedItem.FindControl("lblid"), Label) |
| End If |
I need to be able to reference these values in the custom validator event as shown below:
| Private Sub HoursPositiveValidator_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles HoursPositiveValidator.ServerValidate |
|
'Create variable to hold instance of validation return array.
Dim ReturnArray = LeaveClass.CustomDateValidation(FirstGridDateTimePicker.selectedvalue, SecondGridDateTimePicker.selectedvalue)
|
| If returnarray(0) = "False" then args.isvalid = false End If End Sub |
Thanks,
Jonathan Adkins