I am using Winform And C#.
In that i added calander cell in datagridview control using below link code.
It perfectly working.
http://msdn.microsoft.com/en-us/library/7tas5c80.aspx.
My code for calendar control adding….
foreach (DataGridViewRow row in this.dataGridView2.Rows)
{
row.Cells[4].Value = DateTime.Now;
}

i know MinDate and MaxDate propriety available on normal control.
dateTimePicker1.MinDate = DateTime.Today;
dateTimePicker1.MaxDate = DateTime.Today.AddYears( 1 );
But I want to set min date and max date in all calander control in datagrid view column.
How to implement min and max date in datagridview datetime control for all rows.,
Please help me.,,
Updated Question
public class CalendarCell : DataGridViewTextBoxCell
{
public CalendarCell()
: base()
{
// Use the short date format.
this.Style.Format = "d";
}
// For Min And Max DATE
public DateTime MaxDate { get; set; }
public DateTime MinDate { get; set; }
public override void InitializeEditingControl(int rowIndex, object
initialFormattedValue, DataGridViewCellStyle dataGridViewCellStyle)
{
// Set the value of the editing control to the current cell value.
base.InitializeEditingControl(rowIndex, initialFormattedValue,
dataGridViewCellStyle);
CalendarEditingControl ctl =
DataGridView.EditingControl as CalendarEditingControl;
// For Min And Max DATE
ctl.MinDate = MinDate;
ctl.MaxDate = MaxDate;
// Use the default row value when Value property is null.
if (this.Value == null)
{
ctl.Value = (DateTime)this.DefaultNewRowValue;
}
else
{
ctl.Value = (DateTime)this.Value;
}
}
My Code,..
But I am not get MinDate and MaxDate Propriety. What is my mistake…
Add new properties to the
CalendarColumnclass:And in the
InitializeEditingControlcontrol, add the following code:You can then set these properties on the column, and they will be reflected in the
DateTimePickers (note that it will be taken into account only for new cells)