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. C#
  4. Displaying data in two grids from three tables

Displaying data in two grids from three tables

Scheduled Pinned Locked Moved C#
question
2 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.
  • W Offline
    W Offline
    wasife
    wrote on last edited by
    #1

    Dear All, I have two grids g1 and g2 and three tables t1,t2,t3. Basically there are only two tables t1 & t3 which have many to many relationship between them for which i have created t2. I want to show the data of t1 in g1 and data of t3 in g2 based on selected row of g1. Can any body tell me how can i do this? Currently i have created two relationships dr1 (between t1 & t2) and dr2 (between t2 & t3) and have databinding like this: g1.DataSource=t1; g2.DataSource=t1; g2.DataMember="dr1.dr2"; This scheme shows the data in g2 but not all the relevant rows in g2 are displayed. Instead just a single row against one row in g1 is displayed. Kindly give me some guidance in this regard. Regards, Wasif Ehsan.

    D 1 Reply Last reply
    0
    • W wasife

      Dear All, I have two grids g1 and g2 and three tables t1,t2,t3. Basically there are only two tables t1 & t3 which have many to many relationship between them for which i have created t2. I want to show the data of t1 in g1 and data of t3 in g2 based on selected row of g1. Can any body tell me how can i do this? Currently i have created two relationships dr1 (between t1 & t2) and dr2 (between t2 & t3) and have databinding like this: g1.DataSource=t1; g2.DataSource=t1; g2.DataMember="dr1.dr2"; This scheme shows the data in g2 but not all the relevant rows in g2 are displayed. Instead just a single row against one row in g1 is displayed. Kindly give me some guidance in this regard. Regards, Wasif Ehsan.

      D Offline
      D Offline
      Dave Sexton
      wrote on last edited by
      #2

      I'd go the easy way out & create two datasets that collect the information I want to display & bind the grids to them.


      I think I'm going to call my next project "Chuck Norris". It's a sure way to guarantee it's unbreakable.

      • • •

      But fortunately we have the nanny-state politicians who can step in to protect us poor stupid consumers, most of whom would not know a JVM from a frozen chicken. Bruce Pierson

      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