Setting value of DataGridView cell

Aug 17, 2009 at 3:52 PM

We are currently unable to set the value of a cell in a DataGridView that has the "EditMode" property set to "EditOnEnter".  Before setting this property the code below would correctly set the value of the cell to "MyValue".  However, after we set the property (EditMode = DataGridViewEditMode.EditOnEnter), we cannot set the value.

Any ideas?

 


myDataGridView.Rows[0].Cells[0].Value = "MyValue";

 

Aug 17, 2009 at 9:14 PM

One of our developers found a "workaround" for this issue.  If you select the first row in the grid, then issue the statement to set the value, it seems to work.  Not sure exactly why, but I thought I'd share the solution in case anyone else runs into the same problem:


myDataGridView.Rows[0].Select();
myDataGridView.Rows[0].Cells[0].Value = "MyValue";
Coordinator
Aug 18, 2009 at 4:56 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.