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. Embedded DataGrids

Embedded DataGrids

Scheduled Pinned Locked Moved ASP.NET
game-devhardwaretutorialquestion
7 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.
  • P Offline
    P Offline
    Paul Riley
    wrote on last edited by
    #1

    Okay, this one's bugging me. I'm 99% sure I managed to figure it out a few weeks ago when I had some time on my hands. Now that I'm in a rush I just can't see it or find the example I did before. I have two related tables in a dataset (Player and Game). Each player can have any number of games. I want to show a datagrid with a player (with numerous details) in each row and then embed a datagrid in that row which shows all the games he's played in. I could do all that if I could only figure out what to use as the "DataSource" for the embedded (Game) datagrid. Any ideas? Does it complicate matters that the DataSource for the outer (Player) datagrid is a DataView, rather than the DataTable? Paul And you run and you run to catch up with the sun, but it's sinking
    Racing around to come up behind you again
    The sun is the same in a relative way, but you're older
    Shorter of breath, one day closer to death
    - Pink Floyd, Time

    L 1 Reply Last reply
    0
    • P Paul Riley

      Okay, this one's bugging me. I'm 99% sure I managed to figure it out a few weeks ago when I had some time on my hands. Now that I'm in a rush I just can't see it or find the example I did before. I have two related tables in a dataset (Player and Game). Each player can have any number of games. I want to show a datagrid with a player (with numerous details) in each row and then embed a datagrid in that row which shows all the games he's played in. I could do all that if I could only figure out what to use as the "DataSource" for the embedded (Game) datagrid. Any ideas? Does it complicate matters that the DataSource for the outer (Player) datagrid is a DataView, rather than the DataTable? Paul And you run and you run to catch up with the sun, but it's sinking
      Racing around to come up behind you again
      The sun is the same in a relative way, but you're older
      Shorter of breath, one day closer to death
      - Pink Floyd, Time

      L Offline
      L Offline
      leppie
      wrote on last edited by
      #2

      How about the datagrid in a datalist? MyDUMeter: a .NET DUMeter clone
      "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."

      P 2 Replies Last reply
      0
      • L leppie

        How about the datagrid in a datalist? MyDUMeter: a .NET DUMeter clone
        "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."

        P Offline
        P Offline
        Paul Riley
        wrote on last edited by
        #3

        Why should it make a difference? A DataList binds in the same way as a DataGrid, doesn't it? And thus the inner DataSource should be the same either way. But I really do need it to be a DataGrid, we're talking about 500+ rows with a lot of data in each; it'll be about 500K to download if I can't use paging :-D Paul And you run and you run to catch up with the sun, but it's sinking
        Racing around to come up behind you again
        The sun is the same in a relative way, but you're older
        Shorter of breath, one day closer to death
        - Pink Floyd, Time

        1 Reply Last reply
        0
        • L leppie

          How about the datagrid in a datalist? MyDUMeter: a .NET DUMeter clone
          "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."

          P Offline
          P Offline
          Paul Riley
          wrote on last edited by
          #4

          Come to think of it, a DataRepeater (or even a DataList) within the DataGrid might be an option... maybe even preferable... but the question still remains the same. Paul And you run and you run to catch up with the sun, but it's sinking
          Racing around to come up behind you again
          The sun is the same in a relative way, but you're older
          Shorter of breath, one day closer to death
          - Pink Floyd, Time

          L 1 Reply Last reply
          0
          • P Paul Riley

            Come to think of it, a DataRepeater (or even a DataList) within the DataGrid might be an option... maybe even preferable... but the question still remains the same. Paul And you run and you run to catch up with the sun, but it's sinking
            Racing around to come up behind you again
            The sun is the same in a relative way, but you're older
            Shorter of breath, one day closer to death
            - Pink Floyd, Time

            L Offline
            L Offline
            leppie
            wrote on last edited by
            #5

            Perhaps a custom server control? What about a datagrid in a templated column? MyDUMeter: a .NET DUMeter clone
            "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."

            P 2 Replies Last reply
            0
            • L leppie

              Perhaps a custom server control? What about a datagrid in a templated column? MyDUMeter: a .NET DUMeter clone
              "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."

              P Offline
              P Offline
              Paul Riley
              wrote on last edited by
              #6

              leppie wrote: Perhaps a custom server control? Shouldn't be any need for that. leppie wrote: What about a datagrid in a templated column? That's what I'm trying to do. :-D In the outer DataGrid, I have a single TemplateColumn, containing a table for the player details. Underneath that table (in the same DataGrid cell), I want another DataGrid or table-building DataRepeater to show the game details. So I'm trying to build a DataGrid at this point, but I need to know what to put in the DataSource property to say "I want all the games linked to the player (which at that point is know as Container.DataItem)" Paul And you run and you run to catch up with the sun, but it's sinking
              Racing around to come up behind you again
              The sun is the same in a relative way, but you're older
              Shorter of breath, one day closer to death
              - Pink Floyd, Time

              1 Reply Last reply
              0
              • L leppie

                Perhaps a custom server control? What about a datagrid in a templated column? MyDUMeter: a .NET DUMeter clone
                "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."

                P Offline
                P Offline
                Paul Riley
                wrote on last edited by
                #7

                I've found a temporary solution:

                DataSource=<%# new System.Data.DataView(dsIndView.Game,
                	DataBinder.Eval(Container.DataItem, "PlayerID", "PlayerID = '{0}'"),
                	"Round",
                	System.Data.DataViewRowState.CurrentRows) %>
                

                It's a bit tacky and I can't put quotes around it (because it includes both kinds of quote), so I can't view it in design mode. But it works and that's good enough for now. If anyone has a better solution, please holler! Paul And you run and you run to catch up with the sun, but it's sinking
                Racing around to come up behind you again
                The sun is the same in a relative way, but you're older
                Shorter of breath, one day closer to death
                - Pink Floyd, Time

                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