Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Can you please advice on disabling the dates in the Calendar column in datagridview control.Below is the requirement

-> User is not allowed to select a date which is less than today's date and the next 1 month dates.

Example -
Today's Date -  **Sep 12th 2014** 
Now all the dates less than Sep12th,2014 are disabled and the dates till **Oct12,2014**
i.e till next month are disabled.
So user is allowed to select the dates only after Oct12th,2014.

--> When the calendar column is added to the Datagrid..it must already show the dates from next month.As per above example from
Oct13th,2014.


Can you pls advice on how can i achieve this.

Thanks, Prathap
Posted
Updated 13-Sep-14 8:45am
v2
Comments
kbrandwijk 13-Sep-14 13:04pm    
That really depends on which control you are using. Some calendar controls allow you to disable dates, all calendar controls allow initial selection (because that's the value that the control is bound to). All calendar controls have different events, for example DateChanged, to allow you to respond to the selection of a different date. You can also use the Validating events for example. Please provide some more information.
George Jonsson 13-Sep-14 13:31pm    
As far as know there is no Calendar column for DataGridView.
http://msdn.microsoft.com/en-us/library/vstudio/system.windows.forms.datagridviewcolumn(v=vs.100).aspx[^]
Is this some homemade column type?
Abdul Samad KP 14-Sep-14 1:43am    
As George Jonsson said there is no calendar column for Datagrid view, if you are using a custom datetime picker control, you can set MinDate.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900