Memento

Memento

  • NA
  • 111
  • 131.7k

How to split dgv cellsContent by divider and join them again ?

Jun 17 2012 11:28 PM
I have two dgvs and two buttons.
dgv1.rows[0].Cells[14].Value is (multiline):
r - red
wh - white
y - yellow
So, divider is not "-" but " - " (space line space)

btn1.Click should split this content so that each line go to separate row (dgv2 is not multiline) and so that left side of dividers go into Columns[0] and right side of dividers go into Columns[1]:
r  red
wh   white
y  yellow
gd   gold     //user can add this row or delete some another (in dgv2, not in dgv1)

btn2.Click should join this content again and rewrite dgv1 (with the same divider)
What could be the way, please?

Answers (5)