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. Winform Nested Datagrids - Question

Winform Nested Datagrids - Question

Scheduled Pinned Locked Moved Visual Basic
questioncssdebuggingtutorial
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.
  • S Offline
    S Offline
    Smokeywade
    wrote on last edited by
    #1

    How will I show the child table within the parent table without having to clink on the link - example My main grid loads up fine and it shows the '+' '-' to expand the table, but when I click the '+' I get "datarelation" link once I click that link the table expands. Is it possible to do this with just one click on the '+'? Dont want to use two datagrids, because I want all the info on one grid. Will I have to purchase a third pary product to do this? Here is my code below - am I doing something wrong? Dim command1 As New SqlCommand("Select * FROM LateOrders_Header_view", cnn1) Dim command2 As New SqlCommand("Select * from LateOrders_Line_view", cnn1) 'Dim SqlReader As SqlDataReader Try cnn1.Open() 'Debug.WriteLine(cnn1.ConnectionString) Dim dt As New DataTable("LateOrders_Header_view") dgOrderReport.DataSource = dt Dim DirAdapter As New SqlDataAdapter(command1) Dim DirAdapter2 As New SqlDataAdapter(command2) Dim dc1 As DataColumn Dim dc3 As DataColumn Dim datarelation As DataRelation MyDataSet = New DataSet DirAdapter.TableMappings.Add("tabel1", "LateOrders_Header_view") DirAdapter.TableMappings.Add("tabel2", "LateOrders_line_view") DirAdapter.Fill(MyDataSet, "LateOrders_Header_view") DirAdapter2.Fill(MyDataSet, "LateOrders_Line_view") dc1 = MyDataSet.Tables("LateOrders_Header_view").Columns("order_no") dc3 = MyDataSet.Tables("LateOrders_Line_view").Columns("order_no") datarelation = New DataRelation("Line View", dc1, dc3) MyDataSet.Relations.Add(datarelation) 'dc3.ReadOnly = True dgOrderReport.DataSource = MyDataSet.DefaultViewManager '.Tables("LateOrders_Header_view").DefaultView dgOrderReport.DataMember = "LateOrders_header_view" Any Ideas?

    Thank You

    L 1 Reply Last reply
    0
    • S Smokeywade

      How will I show the child table within the parent table without having to clink on the link - example My main grid loads up fine and it shows the '+' '-' to expand the table, but when I click the '+' I get "datarelation" link once I click that link the table expands. Is it possible to do this with just one click on the '+'? Dont want to use two datagrids, because I want all the info on one grid. Will I have to purchase a third pary product to do this? Here is my code below - am I doing something wrong? Dim command1 As New SqlCommand("Select * FROM LateOrders_Header_view", cnn1) Dim command2 As New SqlCommand("Select * from LateOrders_Line_view", cnn1) 'Dim SqlReader As SqlDataReader Try cnn1.Open() 'Debug.WriteLine(cnn1.ConnectionString) Dim dt As New DataTable("LateOrders_Header_view") dgOrderReport.DataSource = dt Dim DirAdapter As New SqlDataAdapter(command1) Dim DirAdapter2 As New SqlDataAdapter(command2) Dim dc1 As DataColumn Dim dc3 As DataColumn Dim datarelation As DataRelation MyDataSet = New DataSet DirAdapter.TableMappings.Add("tabel1", "LateOrders_Header_view") DirAdapter.TableMappings.Add("tabel2", "LateOrders_line_view") DirAdapter.Fill(MyDataSet, "LateOrders_Header_view") DirAdapter2.Fill(MyDataSet, "LateOrders_Line_view") dc1 = MyDataSet.Tables("LateOrders_Header_view").Columns("order_no") dc3 = MyDataSet.Tables("LateOrders_Line_view").Columns("order_no") datarelation = New DataRelation("Line View", dc1, dc3) MyDataSet.Relations.Add(datarelation) 'dc3.ReadOnly = True dgOrderReport.DataSource = MyDataSet.DefaultViewManager '.Tables("LateOrders_Header_view").DefaultView dgOrderReport.DataMember = "LateOrders_header_view" Any Ideas?

      Thank You

      L Offline
      L Offline
      Lucky Sheikh
      wrote on last edited by
      #2

      so wht,s the problem simply just apply the condition on + button and - button. +button.click=dgv1, dgv2 else false hope u understand byeeeeeeee lucky

      S 1 Reply Last reply
      0
      • L Lucky Sheikh

        so wht,s the problem simply just apply the condition on + button and - button. +button.click=dgv1, dgv2 else false hope u understand byeeeeeeee lucky

        S Offline
        S Offline
        Smokeywade
        wrote on last edited by
        #3

        Nope I dont understand - I dont have any button conditions because of this below- datarelation = New DataRelation("Line View", dc1, dc3) MyDataSet.Relations.Add(datarelation) creates the + - condition on the grid. When the app is running when I click on a record it expands and you see a link that says "Line View" once I clink that link it opens a different table - I dont want it to do that I want it to show the nested table with just one click on the row Is there away to raise a condition to control the + and - that comes with datarelation? Oh Yea I'm not using two datagrids - One datagrid with two datasets. Well One dataset two tables. -- modified at 8:28 Friday 7th September, 2007 -- modified at 9:30 Friday 7th September, 2007

        Thank You

        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