hi there,
this question have posted before also, but i ahave some more questions as well.
when i try to validate the datagridview cell which evet should i use in the datagrid view.
i and using the dgvActions_CellValidating event,but the thing is i want to validate the cell after the cell value has been selected.
the code i have written does the validation when i click on another cell in the datagrid view.
i have written the code to validate the datagridview cell 2 , but whe i clicl cell 3 only the validation event is triggered for cell 2.
why is this happening.
how can i make the validation trigger so that the value of the current cell is seelcted.
the code i wrote is below.
int row = dgvActions.SelectedCells[0].RowIndex;
if (e.ColumnIndex == 2)
{
if (e.FormattedValue != null)
{
String TodayDate = System.DateTime.Now.Date.ToString();
int r = TodayDate.IndexOf(" ");
String date = TodayDate.Substring(0, r);
String Duedate = e.FormattedValue.ToString();
if (Duedate.CompareTo(date) < 0)
{
MessageBox.Show("invalid date");
}
}
}
thanxxxx