Product Bundles
DevCraft
All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:
Web
Mobile
Document Management
Desktop
Reporting
Testing & Mocking
CMS
UI/UX Tools
Debugging
Free Tools
Support and Learning
Productivity and Design Tools
protected
void
RadGrid1_ItemDataBound(
object
sender, GridItemEventArgs e)
{
if
(e.Item
is
GridDataItem)
GridDataItem item = (GridDataItem)e.Item;
RadDatePicker picker1 = (RadDatePicker)item.FindControl(
"RadDatePicker1"
);
RadDatePicker picker2 = (RadDatePicker)item.FindControl(
"RadDatePicker2"
CompareValidator compValidate = (CompareValidator)item.FindControl(
"CompareValidator1"
compValidate.ControlToValidate =picker1.ID;
compValidate.ControlToCompare = picker2.ID;
compValidate.ValueToCompare = DateTime.Now.ToShortDateString();
compValidate.Type = ValidationDataType.Date;
compValidate.Operator = ValidationCompareOperator.LessThanEqual;
compValidate.ErrorMessage =
"EndDate should not be less than StartDate"
;
}