interaction between two datagridview
-
Hello, I have 2 datagridviews, DGV1 and DGV2. I need to make "dynamic interaction" between them, what I mean is the following: when I am clicking on specific row in DGV1 I need to highlight correspondant row in DGV2. Until here everything works fine. But in addition, I need the vice-versa:when I am clicking on specific row in DGV2 I need to highlight correspondant row in DGV1. I am using DGV1_CellEnter and DGV2_CellEnter events The problem is that I got error that each one call to the other (loop). I can solve the problem by inserting flag but I would like to know if there is a better and elegant way. Thank you
Shay Noy
-
Hello, I have 2 datagridviews, DGV1 and DGV2. I need to make "dynamic interaction" between them, what I mean is the following: when I am clicking on specific row in DGV1 I need to highlight correspondant row in DGV2. Until here everything works fine. But in addition, I need the vice-versa:when I am clicking on specific row in DGV2 I need to highlight correspondant row in DGV1. I am using DGV1_CellEnter and DGV2_CellEnter events The problem is that I got error that each one call to the other (loop). I can solve the problem by inserting flag but I would like to know if there is a better and elegant way. Thank you
Shay Noy
Short answer, check to see whether the selection of the grid you're working with matches the other selection before changing it. That way, only one update will occurr.
-
Short answer, check to see whether the selection of the grid you're working with matches the other selection before changing it. That way, only one update will occurr.
Can you please be more explicit. Thank you
Shay Noy