Hi,
Telerik Team ,
I am facing validation related problem in Rad Grid (Batch Editing).
It seems that validation is not working as expected .Please help me on
the same.
My current telerik verion is '2015.2.826.45'. Please let me know
whether this version supports validation or need to update it to never
version .
sample code
<
telerik:RadGrid
ID
=
"EmployeeRadGrid"
GridLines
=
"None"
runat
=
"server"
Width
=
"99.3%"
PageSize
=
"10"
AutoGenerateColumns
=
"False"
AllowAutomaticInserts
=
"True"
AllowAutomaticDeletes
=
"True"
AllowAutomaticUpdates
=
"True"
AllowSorting
=
"false"
AllowPaging
=
"True"
OnPreRender
=
"EmployeeRadGrid_PreRender"
OnNeedDataSource
=
"EmployeeRadGrid_NeedDataSource"
OnBatchEditCommand
=
"EmployeeRadGrid_BatchEditCommand"
OnPageIndexChanged
=
"EmployeeRadGrid_PageIndexChanged"
OnPageSizeChanged
=
"EmployeeRadGrid_PageSizeChanged"
>
<
MasterTableView
CommandItemDisplay
=
"TopAndBottom"
HorizontalAlign
=
"NotSet"
EditMode
=
"Batch"
AutoGenerateColumns
=
"False"
CommandItemSettings-ShowRefreshButton
=
"false"
ValidateRequestMode
=
"Enabled"
>
<
BatchEditingSettings
EditType
=
"Row"
/>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"EmployeeNumber"
HeaderStyle-Width
=
"15%"
HeaderText
=
"Employee Number"
UniqueName
=
"EmployeeNumber"
ItemStyle-Width
=
"10%"
ColumnValidationSettings-EnableRequiredFieldValidation
=
"true"
>
<
ColumnValidationSettings
EnableRequiredFieldValidation
=
"true"
EnableModelErrorMessageValidation
=
"true"
>
<
RequiredFieldValidator
ForeColor
=
"Red"
ErrorMessage
=
"*Required"
Display
=
"Static"
SetFocusOnError
=
"true"
>
</
RequiredFieldValidator
>
<
ModelErrorMessage
SetFocusOnError
=
"true"
/>
</
ColumnValidationSettings
>
</
telerik:GridBoundColumn
>
<
telerik:GridTemplateColumn
UniqueName
=
"OrganizationName"
HeaderText
=
"Organization"
DataField
=
"Organization"
HeaderStyle-Width
=
"10%"
>
<
ItemTemplate
>
<%#Eval("Organization") %>
</
ItemTemplate
>
<
EditItemTemplate
>
<
telerik:RadComboBox
runat
=
"server"
ID
=
"OrganizationRadComboBox"
Width
=
"100px"
>
</
telerik:RadComboBox
>
<
asp:RequiredFieldValidator
ForeColor
=
"Red"
ControlToValidate
=
"OrganizationRadComboBox"
runat
=
"server"
ErrorMessage
=
"*Required"
Display
=
"Static"
></
asp:RequiredFieldValidator
>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridDateTimeColumn
UniqueName
=
"Date"
PickerType
=
"DatePicker"
HeaderText
=
"Date"
HeaderStyle-Width
=
"14%"
DataField
=
"TransactionDate"
DataFormatString
=
"{0:MM/dd/yyyy}"
DataType
=
"System.DateTime"
>
<
ColumnValidationSettings
EnableRequiredFieldValidation
=
"true"
>
<
RequiredFieldValidator
ForeColor
=
"Red"
Text
=
"*Required"
Display
=
"Static"
>
</
RequiredFieldValidator
>
</
ColumnValidationSettings
>
</
telerik:GridDateTimeColumn
>
<
telerik:GridDateTimeColumn
UniqueName
=
"Time"
PickerType
=
"TimePicker"
HeaderText
=
"Time"
HeaderStyle-Width
=
"14%"
DataField
=
"TransactionTime"
DataType
=
"System.DateTime"
DataFormatString
=
"{0:HH:MM}"
>
<
ColumnValidationSettings
EnableRequiredFieldValidation
=
"true"
>
<
RequiredFieldValidator
ForeColor
=
"Red"
Text
=
"*Required"
Display
=
"Static"
>
</
RequiredFieldValidator
>
</
ColumnValidationSettings
>
</
telerik:GridDateTimeColumn
>
<
telerik:GridTemplateColumn
UniqueName
=
"Contact"
HeaderText
=
"Contact"
HeaderStyle-Width
=
"10%"
DataField
=
"Contact"
>
<
ItemTemplate
>
<%#Eval("Contact") %>
</
ItemTemplate
>
<
EditItemTemplate
>
<
telerik:RadNumericTextBox
runat
=
"server"
ID
=
"radNumericTextBox"
MinValue
=
"0"
NumberFormat-DecimalDigits
=
"0"
MaxValue
=
"2147483647"
Width
=
"200px"
>
</
telerik:RadNumericTextBox
>
<
asp:RequiredFieldValidator
ForeColor
=
"Red"
ControlToValidate
=
"radNumericTextBox"
runat
=
"server"
ErrorMessage
=
"*Required"
Display
=
"Static"
></
asp:RequiredFieldValidator
>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
</
Columns
>
</
MasterTableView
>
<
ClientSettings
AllowKeyboardNavigation
=
"true"
>
<%--<
ClientEvents
OnRowCreating
=
"OnRowCreating"
/>--%>
</
ClientSettings
>
</
telerik:RadGrid
>