I need to have clientside validation and server side validation for gridnumeric columns
I have 4 columns ( Grid Numeric columns) and total column and I need to make sure the total of this cannot be less than zero
I tried to do this in Item created event , but not successfull
<telerik:GridNumericColumn DataField="AMT1" UniqueName="AMT1" HeaderText="Amount1"
DataType="System.Int32" DataFormatString="{0:N0}" DecimalDigits="0"
ForceExtractValue="Always" SortExpression="Amount1" AllowFiltering="false" EmptyDataText="0"
Aggregate="Sum" FooterAggregateFormatString="{0:c0}" FooterStyle-HorizontalAlign="Right" >
</telerik:GridNumericColumn>
Item created event
If (TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode) Then
Dim edititem As GridEditableItem = CType(e.Item, GridEditableItem)
For Each GridColumn As GridColumn In edititem.OwnerTableView.Columns
If GridColumn.IsEditable Then
Dim editor As GridNumericColumnEditor = TryCast(edititem.EditManager.GetColumnEditor(GridColumn.UniqueName), GridNumericColumnEditor)
If editor IsNot Nothing Then ' This is mainly to skip the other type of columns and read only numeric columns
Dim cell As TableCell = CType(editor.NumericTextBox.Parent, TableCell)
Dim validator As CustomValidator = New CustomValidator
validator.ErrorMessage = "Total should be >0"
validator.Display = ValidatorDisplay.Dynamic
validator.ForeColor = Drawing.Color.DarkRed
validator.ControlToValidate =""
validator.ValidationGroup = "total"
validator.ClientValidationFunction =
"validatetotal"
cell.Controls.Add(validator)
End If
End If
Next
End If
--------------------------------------------------
I am not even seeing the "OnServerValidate" Property.
Please suggest a solution
Thanks