Hi,
My datagridview contains 3 columns, I have displayed values in these cells on the cell enter event, if the user do not enter any value in any of three cells, the new row is not added. The new row only get added if the value in written in any of the cell. So, what can i do to add a new row on the cell leave event of the last cell.
Thanks,
Vidya
Loading
Deepak BhatiaPosted Oct 6, 2009, 2:06 AM
Deepak BhatiaPosted Oct 6, 2009, 2:02 AM
Vidya YadavPosted Oct 6, 2009, 1:53 AM
Now only the problem is when the new row is added as it is the last row the focus leaves the datagridview and goes on other control the inserted the following line but didn't work now what can i do....
if (e.ColumnIndex == 9 && flagDoIt == true)
{
Thread t = new Thread(pAddRowInDatagrid);
t.Start();
flagDoIt = false;
}
private void pAddRowInDatagrid()
{
grdtreatment.Rows.Add(1);
grdtreatment.Focus();
}
I want that focus must be on the first cell of newly added row...
Thanks,
Vidya
Deepak BhatiaPosted Oct 6, 2009, 1:52 AM
Vidya YadavPosted Oct 6, 2009, 1:34 AM
Regards,
Vidya
Deepak BhatiaPosted Oct 6, 2009, 1:18 AM
Vidya YadavPosted Oct 6, 2009, 1:03 AM
At the form load there will be one row, then when i will leave the last cell of the first row then there should be one row added.
Regards,
Vidya
Deepak BhatiaPosted Oct 6, 2009, 12:54 AM