Undo list on datagridview

Hi, Im trying to create dgv with undo function...so im trying to save datagridviewrow ( not just data, but fore and backcolors, fonts) in collection, datatable....

problem is that ,for example, after five changes on same row I get five identical rows from my collection...its like coll refresh all its innerlist values with last added row!!!!

[355 byte] By [zmrcic] at [2008-1-10]
# 1
what exactly did you do to UNDO the operation? if you simply update the value on the row 5 times, I dont think there will be any duplicate.

zmrcic wrote:

Hi, Im trying to create dgv with undo function...so im trying to save datagridviewrow ( not just data, but fore and backcolors, fonts) in collection, datatable....

problem is that ,for example, after five changes on same row I get five identical rows from my collection...its like coll refresh all its innerlist values with last added row!!!!

H.Tony at 2007-10-3 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 2

? I have a list that stores every row(data,cellstyle...)...and I have one row in dgv...

1. cnahge forecolor of first 5 cells and store row in list

so first five cells are red and last five are black

2. cnahge forecolor of last 5 cells and store row in list

so first five cells are red and last five are blue

when i look into list bouth entries have same values for last five cells...?

zmrcic at 2007-10-3 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 3
Sorry, I dont quite understand what you mean. Do you mind checking what's the row in dgv and what the values in list after operation 1 and operation 2? I mean, debug into it and watch values after each operation?

zmrcic wrote:

? I have a list that stores every row(data,cellstyle...)...and I have one row in dgv...

1. cnahge forecolor of first 5 cells and store row in list

so first five cells are red and last five are black

2. cnahge forecolor of last 5 cells and store row in list

so first five cells are red and last five are blue

when i look into list bouth entries have same values for last five cells...?

H.Tony at 2007-10-3 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 4

I did...they are the same

zmrcic at 2007-10-3 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 5
so the operatoin never changes the last 5 cells? maybe you can step into your 2nd operation and check why they never change them?

zmrcic wrote:

I did...they are the same

H.Tony at 2007-10-3 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 6

No T, its like ilist always refresh it self on all positions with row last state...

zmrcic at 2007-10-3 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 7

Back to my first question...HOW TO IMPLEMENT UNDO ON DATAGRIDVIEW!!!!!

and not just cells data, but also tags and style?

zmrcic at 2007-10-3 > top of Msdn Tech,Windows Forms,Windows Forms General...