Hi.
I have a RadDateTimePicker in a grid.How i can compare SelectedDate(DateTime type!) with today's date?
My code:
Please help,
Thanks.
I have a RadDateTimePicker in a grid.How i can compare SelectedDate(DateTime type!) with today's date?
My code:
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) { if (e.Item is GridEditableItem && e.Item.IsInEditMode) { GridEditableItem item = e.Item as GridEditableItem; RadDateTimePicker startDate = (RadDateTimePicker)item.FindControl("startDate"); TableCell cell = (TableCell)start.Parent; CompareValidator CV1 = new CompareValidator(); CV1.ErrorMessage = "*"; CV1.ControlToValidate = startDate.ID; CV1.Operator = ValidationCompareOperator.GreaterThanEqual; CV1.ValueToCompare = DateTime.Now.ToString(); cell.Controls.Add(CV1); } }Thanks.