Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. interaction between two datagridview

interaction between two datagridview

Scheduled Pinned Locked Moved Visual Basic
help
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    helelark123
    wrote on last edited by
    #1

    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

    S 1 Reply Last reply
    0
    • H helelark123

      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

      S Offline
      S Offline
      Steve Westbrook
      wrote on last edited by
      #2

      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.

      H 1 Reply Last reply
      0
      • S Steve Westbrook

        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.

        H Offline
        H Offline
        helelark123
        wrote on last edited by
        #3

        Can you please be more explicit. Thank you

        Shay Noy

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups