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?
Loading

VulpesPosted Jun 18, 2012, 11:53 AM
string regExp = @"(\w+)\s+-\s+(\w+\s?\w+)";
MementoPosted Jun 18, 2012, 11:41 AM
In some cases the right side of starting string (dgv1) has two words (for example: "red brown"), and the result in dgv2 is the first word only.
I will try to match it, although, I really doesn't understand some lines of your code.
Or, with yours approval, I would place your code on MSDN forum,
and ask if someone could translate it - to a "normalC#Language".
VulpesPosted Jun 18, 2012, 10:24 AM
MementoPosted Jun 18, 2012, 7:32 AM
dgv1 has always one row, only.
Sorry, I missed to tell this.
So, the whole story from dgv2 (column[0] and column[1]) has its source in one single dgv1.Cell and should be packed back into that cell.
VulpesPosted Jun 18, 2012, 5:48 AM