DataGridViewRow Problem (Formatting not updating)
I am having problems with my DataGridView.
I have two colums in this row. Text, and Cost. In the cost Column, I have the DefaultCellStyle Format set to C2 (As a number).
When I add rows (DataGridView.Rows.Add("Text", "5")), it formats it correctly as $5.00 (In the Cost Column).
The problem I am having is on an update. I want to be able to format the row correctly when a user edits the row. When I edit the row, DataGridView_CellEndEdit shows me the value "5", but not the correctly formatted value, nor can I update the format for the user.
How would I update the format?
Re: DataGridViewRow Problem (Formatting not updating)
Something like myDataGridView(int col,int row).Value = String.Format("{0:C}", myDataGridView(int col, int row).Value)
???
Re: DataGridViewRow Problem (Formatting not updating)
Would this go into the Cell Validating Method, or CellEndEdit.
I just don't understand why it doesn't update the format. The Cell Inherited style should see that it should be formatted as "C2", don't understand why I have to manually update it.