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. Web Development
  3. ASP.NET
  4. How to let two gridview side by side in one form?

How to let two gridview side by side in one form?

Scheduled Pinned Locked Moved ASP.NET
sysadmintutorialquestion
3 Posts 3 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.
  • R Offline
    R Offline
    rushing
    wrote on last edited by
    #1

    Because there is only one form running at server in one page, I let two gridview in one form. However, they are in 2 level, not side by side. How to do ? Thanks!

    A B 2 Replies Last reply
    0
    • R rushing

      Because there is only one form running at server in one page, I let two gridview in one form. However, they are in 2 level, not side by side. How to do ? Thanks!

      A Offline
      A Offline
      Arvind B
      wrote on last edited by
      #2

      '------------------------------------------------ 'place a grid dgMaster 'inside a template col place grid dgChild 'u can design both grid at design time 'call below code after binding master grid 'u can also do this in itemcreated event '------------------------------------------------ '--declare a data grid object Dim dgchild As DataGrid '--suppose the master grid is dgmaster '--loop thro all items of a datagrid For i = 0 To dgMaster.Items.Count - 1 'find child grid dgChild = dgMaster.Items(i).FindControl("dgChild") 'bind this grid dgchild.DataSource = myDataSource dgchild.DataBind() Next Hope this helps Arvind B

      1 Reply Last reply
      0
      • R rushing

        Because there is only one form running at server in one page, I let two gridview in one form. However, they are in 2 level, not side by side. How to do ? Thanks!

        B Offline
        B Offline
        boo
        wrote on last edited by
        #3

        Or you could just:

        DataGrid1

        DataGrid2

        Don't over-think things :)

        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