hi there,
i have a datagrid view in a form and i have a calender control in one of the cells.
when i try to validate it it gives an invalidCastException.(the line is bolded, this is tha place where the error occurs)
private void dgvActions_CellValidating(object sender, DataGridViewCellValidatingEventArgs e)
{
if (e.ColumnIndex == 2)
{
if (e.FormattedValue != null)
{
DateTime TodayDate = System.DateTime.Now.Date;
[B]DateTime Duedate = (DateTime)e.FormattedValue;[/B]
if (Duedate < TodayDate)
MessageBox.Show("invalid");
}
}
}
how can i solve this.
thankxxxxx