I'm using an unbound WinForms DataGridView, to allow for user changes
to certain data to be saved. However, I'm uncertain how to access the
string value of what a user has typed into a cell. DataGridViewCell
has a value and a formatted value property, but I've noticed that
sometimes FormattedValue is an empty string, and I'm not sure what
kind of objects will come out of value.
What's the best way to get the string representation for input in a
cell, so I can test it for syntax problems, and for numeric cells,
make sure the value is within certain bounds?
RobinS - 20 Mar 2008 07:26 GMT
If your DataGridView is called dgv, try something like dgv.Cells[0,0], where
0 and 0 are the row and column of the cell.
RobinS.
> I'm using an unbound WinForms DataGridView, to allow for user changes
> to certain data to be saved. However, I'm uncertain how to access the
[quoted text clipped - 6 lines]
> cell, so I can test it for syntax problems, and for numeric cells,
> make sure the value is within certain bounds?