datagridview reverts changes when using the InsertCopy-Method?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rilkar
    New Member
    • Sep 2015
    • 1

    datagridview reverts changes when using the InsertCopy-Method?

    Upon commiting changes to a row the following method is executed:
    Code:
    ...
    // Commit the value to another function and read back a properly formatted string. E.g. if the value was 123 it will now be 123.00
    dataGridView1[e.ColumnIndex, e.RowIndex].Value = Manager.UpdateTransaction(newRow, e.ColumnIndex, dataGridView1[e.ColumnIndex, e.RowIndex].Value.ToString());
    ...
    // the value of the cell dataGridView1[3,e.RowIndex+1].Value is 123.00
    // delta is negative in the next command
    dataGridView1.Rows.InsertCopy(e.RowIndex, e.RowIndex + delta);
    // the previous row is now located 1 row further dataGridView1[3,e.RowIndex+1].Value
    however is now 123 instead of 123.00

    Why is the string value being reset from 123.00 to 123? It doesn't make any sense to me...
    Last edited by Rabbit; Sep 13 '15, 05:11 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data.
Working...