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. 2 dimensional array of objects

2 dimensional array of objects

Scheduled Pinned Locked Moved C#
cssdata-structures
9 Posts 5 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.
  • D Offline
    D Offline
    dwolver 0
    wrote on last edited by
    #1

    Looking for some ideas on a framework for managing a 2 dimensional(dynamic size) array of objects. Something like a grid where one can access by row and column

    L M realJSOPR 3 Replies Last reply
    0
    • D dwolver 0

      Looking for some ideas on a framework for managing a 2 dimensional(dynamic size) array of objects. Something like a grid where one can access by row and column

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Would a System.Collections.Generic.Dictionary<tkey,> suffice?

      I are troll :)

      1 Reply Last reply
      0
      • D dwolver 0

        Looking for some ideas on a framework for managing a 2 dimensional(dynamic size) array of objects. Something like a grid where one can access by row and column

        M Offline
        M Offline
        musefan
        wrote on last edited by
        #3

        Maybe you could try a List of Lists? then write a function for getting with row column parameters

        M 1 Reply Last reply
        0
        • D dwolver 0

          Looking for some ideas on a framework for managing a 2 dimensional(dynamic size) array of objects. Something like a grid where one can access by row and column

          realJSOPR Offline
          realJSOPR Offline
          realJSOP
          wrote on last edited by
          #4

          Use the Dictionary object.

          "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
          -----
          "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

          D 1 Reply Last reply
          0
          • M musefan

            Maybe you could try a List of Lists? then write a function for getting with row column parameters

            M Offline
            M Offline
            musefan
            wrote on last edited by
            #5

            List<object> objCols = new List<object>();
            List<list> objRows = new List<list>();

            object GetCell(int row, int col)
            {

            return objRows[row][col];

            }

            Not tested but something along those lines perhaps BTW 'List' can be found in System.Collections.Generic

            modified on Friday, January 30, 2009 9:44 AM

            D 1 Reply Last reply
            0
            • M musefan

              List<object> objCols = new List<object>();
              List<list> objRows = new List<list>();

              object GetCell(int row, int col)
              {

              return objRows[row][col];

              }

              Not tested but something along those lines perhaps BTW 'List' can be found in System.Collections.Generic

              modified on Friday, January 30, 2009 9:44 AM

              D Offline
              D Offline
              dwolver 0
              wrote on last edited by
              #6

              Yes this sort of makes sense. I'll have to play with it a bit thanks. dale

              1 Reply Last reply
              0
              • realJSOPR realJSOP

                Use the Dictionary object.

                "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
                -----
                "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

                D Offline
                D Offline
                dwolver 0
                wrote on last edited by
                #7

                Hi John, I'm not familiar with this Dictionary approach. Would you have a small snippet that might help.

                realJSOPR N 2 Replies Last reply
                0
                • D dwolver 0

                  Hi John, I'm not familiar with this Dictionary approach. Would you have a small snippet that might help.

                  realJSOPR Offline
                  realJSOPR Offline
                  realJSOP
                  wrote on last edited by
                  #8

                  I can't give you anything better than you'd find on google. Search on "C# Dictionary Collections". You'll get a gazillion examples.

                  "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
                  -----
                  "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

                  1 Reply Last reply
                  0
                  • D dwolver 0

                    Hi John, I'm not familiar with this Dictionary approach. Would you have a small snippet that might help.

                    N Offline
                    N Offline
                    Najmal
                    wrote on last edited by
                    #9

                    hi.. follow this link... About Dictionary

                    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