This is a migrated thread and some comments may be shown as answers.

Setting minimum date in grid view date time column?

2 Answers 465 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Thomas Douglas
Top achievements
Rank 1
Thomas Douglas asked on 15 Oct 2009, 09:29 PM
Is there a way to set the minimum date for a datetime picker in a grid view?  I am adding a GridViewDateTimeColumn in a grid view but I don't see a property related to minimum date on the GridViewDateTimeColumn class.

I am using the 2008 Q2 version in Winforms.

Thanks,
Byron

2 Answers, 1 is accepted

Sort by
0
Robert
Top achievements
Rank 1
answered on 16 Oct 2009, 07:29 PM
Hello Thomas,

Yes, there is a way to set the minimum date. As described in this forum post, you can do the following:

You can change the min or max date allowed by customizing the editor in the CellBeginEdit or CellEditorInitialized event.

RadDateTimeEditor editor = radGridView1.ActiveEditor as RadDateTimeEditor; 
editor.MinValue = DateTime.Today.AddDays(-10); 
editor.MaxValue = DateTime.Today.AddDays(10); 


I hope this helps.

- Robert
0
Thomas Douglas
Top achievements
Rank 1
answered on 16 Oct 2009, 09:04 PM
Yes, that worked like a charm!
Thanks
Tags
GridView
Asked by
Thomas Douglas
Top achievements
Rank 1
Answers by
Robert
Top achievements
Rank 1
Thomas Douglas
Top achievements
Rank 1
Share this question
or