I have set the readonly property of 2 datatable columns to true.
List.Columns[0].ReadOnly = true;
List.Columns[1].ReadOnly = true;
But i only want them to be read only when user is trying to update, User can add new rows to dataGridView so i want to turn the readonly property to false when trying to add new row. i tried doing this on CellDoubleClick event of the datagrid but it wont do anything as it is to late for the beginedit to be called.
if(e.RowIndex == GridView.Rows.Count-1)
GridView.Rows[e.RowIndex].Cells[1].ReadOnly = GridView.Rows[e.RowIndex].Cells[0].ReadOnly = false;
else
GridView.Rows[e.RowIndex].Cells[1].ReadOnly = GridView.Rows[e.RowIndex].Cells[0].ReadOnly = true;
Any ideas