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. The Lounge
  3. What the hell do I need a grid control for?

What the hell do I need a grid control for?

Scheduled Pinned Locked Moved The Lounge
cssquestion
45 Posts 22 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 Daniel Turini

    Andreas Saurwein wrote: A grid is not to confuse with a listview control, although they may look similar. I thought you were talking on a higher level, about a grid functionality...


    It's not the fall that kills you: it's the sudden stop - Down by Law, Jim Jamursch (1986)

    A Offline
    A Offline
    Andreas Saurwein
    wrote on last edited by
    #20

    No, really specific about "the grid control", whatever brand - Maunder, Dundas, roll-your-own, etc.


    Off to in ~69 days

    1 Reply Last reply
    0
    • A Andreas Saurwein

      I think I lost you... Shog9 wrote: But the beauty of (most) grid controls lies in their ability to standardize behavior where it would otherwise be very difficult to do so How does a grid standardize behaviour? Shog9 wrote: a grid control could be thought of as a tool for generating custom forms on the fly Could you explain that for grid-dummies? :omg: :~


      Off to in ~69 days

      M Offline
      M Offline
      MarkSh
      wrote on last edited by
      #21

      Clearly this passes for humour wherever you live :) Obviously when you only need a list and you have a small amount of read only data, then yes maybe you can manually add your items to a listview or listbox. But if you want any sort of complex databound list or an editable table, grids are your only choice. Then what about grouping, filtering available in commercial solutions all of which are necessary in commercial software. And whilst embedding an excel worksheet is an idea, again it is manual and very very slow - not to mention relying on excel being present....... :(

      A 1 Reply Last reply
      0
      • A Andreas Saurwein

        I think I lost you... Shog9 wrote: But the beauty of (most) grid controls lies in their ability to standardize behavior where it would otherwise be very difficult to do so How does a grid standardize behaviour? Shog9 wrote: a grid control could be thought of as a tool for generating custom forms on the fly Could you explain that for grid-dummies? :omg: :~


        Off to in ~69 days

        S Offline
        S Offline
        Shog9 0
        wrote on last edited by
        #22

        ah, right... that didn't make too much sense, did it? Sorry, just woke up. 'k... A form is a collection of controls displaying data, arranged in some way, and with rules describing how the user may edit that data with keyboard/mouse/etc. While very flexible, a complex form displaying large amounts of data can be difficult for users to understand and navigate. Also, generating forms programatically can be difficult and tedious for the programmer to implement. A grid control can be thought of as a speciallized form. Controls that can appear on it are more limited, and their positioning is constrained, but in return it becomes much easier for the programmer to implement programatic generation. In addition, because of the constraints placed on the types and positions of controls***** in the grid, behavior can be optimized to give the user more power in viewing and editing the data displayed (multiple selection, multiple copy/paste, etc.). It's worth noting btw, that probably the biggest use of grids (in my experience at least) is in displaying (and possibly editing) the results of database queries, where very little about the data can be assumed ahead of time. The mention of Excel is appropriate, as Excel can be and is used to develop many applications - a few examples from my experience include a payroll calculation and database, a complex pricing and report generator, and a database front end. However, at some point Excel apps can become a bad fit, as requirements and/or usage grows, and it becomes necessary to move to some other platform. *****by control here i mean something that displays a single data item, possibly allowing it to be edited - a cell in the grid, not necessarily an actual Windows control. ---

        But, oh god / Under the weight of life / Things seem / Brighter on the other side - David Matthews, Big Eyed Fish

        A 1 Reply Last reply
        0
        • A Andreas Saurwein

          Looking at the most popular items on CP, I really must wonder what someone needs a grid control for? Since Windows 3.0 I am doing GUI programming and I never ever needed a grid control. Are there really so many people writing Excel clones?


          Off to in ~69 days

          A Offline
          A Offline
          abc
          wrote on last edited by
          #23

          Andreas Saurwein wrote: Looking at the most popular items on CP It is not grid control that makes it popular. It is very hard to judge an article and its attached code if the subject is about server communication or algorithm, etc. You literally have to download and set up the sample program on your machine to try it. If the setup process described in the article isn't fool-proof or the machine is missing a required component, most users will give up, unless they really need to use the code. An article about GUI, however, is relatively easy to read and judge. Most of them contain beautiful pictures, and one good picture is worth a thousand dollars (words), you know. May be that's why popular articles on CodeProject don't have to be useful, as long as they look good. P.S. There is no doubt that articles by Chris Maunder and Mike Dunn are useful and they look good, too (sucking up isn't that hard after all, :) )

          A S 2 Replies Last reply
          0
          • D Daniel Turini

            How would I code Desktop Bob[^] without a grid?


            It's not the fall that kills you: it's the sudden stop - Down by Law, Jim Jamursch (1986)

            J Offline
            J Offline
            Jon Newman
            wrote on last edited by
            #24

            Daniel Turini wrote: Desktop Bob[^] Shameless plug :rolleyes: :suss:


            "If you just say porn then you get all manner of chaff and low grade stuff."
            - Paul Watson, Lounge 25 Mar 03
            "But a fresh install - it's like having clean sheets"
            - C. Maunder Lounge 3 Mar '03


            Jonathan 'nonny' Newman Homepage [www.nonny.com] [^]

            1 Reply Last reply
            0
            • A abc

              Andreas Saurwein wrote: Looking at the most popular items on CP It is not grid control that makes it popular. It is very hard to judge an article and its attached code if the subject is about server communication or algorithm, etc. You literally have to download and set up the sample program on your machine to try it. If the setup process described in the article isn't fool-proof or the machine is missing a required component, most users will give up, unless they really need to use the code. An article about GUI, however, is relatively easy to read and judge. Most of them contain beautiful pictures, and one good picture is worth a thousand dollars (words), you know. May be that's why popular articles on CodeProject don't have to be useful, as long as they look good. P.S. There is no doubt that articles by Chris Maunder and Mike Dunn are useful and they look good, too (sucking up isn't that hard after all, :) )

              A Offline
              A Offline
              Andreas Saurwein
              wrote on last edited by
              #25

              Well, you describe one of the phenomenons on CP - have a good looking, blinking editcontrol which shows bitmaps in each typed character and you get a great rating, no matter how bad the code is. :) abc wrote: May be that's why popular articles on CodeProject do have to be useful, as long as they look good. I suppose that should read "...on CodeProject dont have to..." :~ As good as (some) of the articles of CM and MD are, there are others who write excellent articles too.


              Off to in ~69 days

              A 1 Reply Last reply
              0
              • A Andreas Saurwein

                Looking at the most popular items on CP, I really must wonder what someone needs a grid control for? Since Windows 3.0 I am doing GUI programming and I never ever needed a grid control. Are there really so many people writing Excel clones?


                Off to in ~69 days

                M Offline
                M Offline
                moliate
                wrote on last edited by
                #26

                But it's all part of the plan... ? As soon as all the grids connect through the sixth-dimentional hypercube and punctuates the very fabric of time, Cthulhu shall be awakened from his slumber in ancient R'lyeh (Ia Chutulhu, Ia, Ia, Ia) to once again return to his rigthful throne, and we - his humble servants shall see what once where, what we've only seen in His dreams before (Rith'ham Abdul Al'Hazred). Ph'nglui Mglw'nafh Cthulhu R'lyeh Wgah'nagl Fhtagn Sorry. I'm very tired and will go away now.. /moliate


                The corners of my eyes catch hasty, bloodless motion - a mouse? Well, certainly a peripheral of some kind.

                Neil Gaiman - Cold Colours

                1 Reply Last reply
                0
                • A abc

                  Andreas Saurwein wrote: Looking at the most popular items on CP It is not grid control that makes it popular. It is very hard to judge an article and its attached code if the subject is about server communication or algorithm, etc. You literally have to download and set up the sample program on your machine to try it. If the setup process described in the article isn't fool-proof or the machine is missing a required component, most users will give up, unless they really need to use the code. An article about GUI, however, is relatively easy to read and judge. Most of them contain beautiful pictures, and one good picture is worth a thousand dollars (words), you know. May be that's why popular articles on CodeProject don't have to be useful, as long as they look good. P.S. There is no doubt that articles by Chris Maunder and Mike Dunn are useful and they look good, too (sucking up isn't that hard after all, :) )

                  S Offline
                  S Offline
                  Shog9 0
                  wrote on last edited by
                  #27

                  abc wrote: May be that's why popular articles on CodeProject do have to be useful, as long as they look good. Ah... time to write my "nothin' but photos of Angelina Jolie" article i think... ---

                  But, oh god / Under the weight of life / Things seem / Brighter on the other side - David Matthews, Big Eyed Fish

                  1 Reply Last reply
                  0
                  • S Shog9 0

                    ah, right... that didn't make too much sense, did it? Sorry, just woke up. 'k... A form is a collection of controls displaying data, arranged in some way, and with rules describing how the user may edit that data with keyboard/mouse/etc. While very flexible, a complex form displaying large amounts of data can be difficult for users to understand and navigate. Also, generating forms programatically can be difficult and tedious for the programmer to implement. A grid control can be thought of as a speciallized form. Controls that can appear on it are more limited, and their positioning is constrained, but in return it becomes much easier for the programmer to implement programatic generation. In addition, because of the constraints placed on the types and positions of controls***** in the grid, behavior can be optimized to give the user more power in viewing and editing the data displayed (multiple selection, multiple copy/paste, etc.). It's worth noting btw, that probably the biggest use of grids (in my experience at least) is in displaying (and possibly editing) the results of database queries, where very little about the data can be assumed ahead of time. The mention of Excel is appropriate, as Excel can be and is used to develop many applications - a few examples from my experience include a payroll calculation and database, a complex pricing and report generator, and a database front end. However, at some point Excel apps can become a bad fit, as requirements and/or usage grows, and it becomes necessary to move to some other platform. *****by control here i mean something that displays a single data item, possibly allowing it to be edited - a cell in the grid, not necessarily an actual Windows control. ---

                    But, oh god / Under the weight of life / Things seem / Brighter on the other side - David Matthews, Big Eyed Fish

                    A Offline
                    A Offline
                    Andreas Saurwein
                    wrote on last edited by
                    #28

                    Ok, now it really makes more sense :) While I agree on your view of "generating forms programatically", I dont think that a grid control is yet the right choice for implementing it. (Probably I am only a listview control freak) In most cases I find it more complicated to eliminate unwanted features from a grid, than adding new features to a list control. Yes, I did try using a grid a few times, only once a grid actually made it into one of my applications and then only as a optional control in a form designer.


                    Off to in ~69 days

                    S E 2 Replies Last reply
                    0
                    • A Andreas Saurwein

                      Ok, now it really makes more sense :) While I agree on your view of "generating forms programatically", I dont think that a grid control is yet the right choice for implementing it. (Probably I am only a listview control freak) In most cases I find it more complicated to eliminate unwanted features from a grid, than adding new features to a list control. Yes, I did try using a grid a few times, only once a grid actually made it into one of my applications and then only as a optional control in a form designer.


                      Off to in ~69 days

                      S Offline
                      S Offline
                      Shog9 0
                      wrote on last edited by
                      #29

                      Don't get me wrong - a listview control is all that is needed in many, many situations, and by not using it you'd only make your life harder. The right tool for the job, as always... :) ---

                      But, oh god / Under the weight of life / Things seem / Brighter on the other side - David Matthews, Big Eyed Fish

                      1 Reply Last reply
                      0
                      • A Andreas Saurwein

                        Looking at the most popular items on CP, I really must wonder what someone needs a grid control for? Since Windows 3.0 I am doing GUI programming and I never ever needed a grid control. Are there really so many people writing Excel clones?


                        Off to in ~69 days

                        J Offline
                        J Offline
                        John M Drescher
                        wrote on last edited by
                        #30

                        I use grid controls in many of my applications. I do work in medical research and many times you need to list patients, cases, and other data mostly read by a database. Chris's grid control is very good displaying lists of things and I use it anywhere a listbox would be used. I wish there was a WTL version so I could move some of my development in that direction. John

                        1 Reply Last reply
                        0
                        • A Andreas Saurwein

                          Looking at the most popular items on CP, I really must wonder what someone needs a grid control for? Since Windows 3.0 I am doing GUI programming and I never ever needed a grid control. Are there really so many people writing Excel clones?


                          Off to in ~69 days

                          P Offline
                          P Offline
                          Peter Zajac
                          wrote on last edited by
                          #31

                          Common reasons why people switch from a ownerdrwa list view to a grid control are: 1. ease of use. 2. ease of customization on cell level. Often people want to add some display flexibility to your data (color, font, celltypes, etc.). 3. ability to display real time data. 4. foot print. For example Ultimate Grid (by Dundas) only adds around 100k to your application size! 5. performance. In many cases people need to show a data result that is 100's of thousands of rows, the a list view can be used for this but it is much simpler and faster to use a third party grid control that already has support for what you need. After all would you rather spend days developing your own implementation of the list view, or would you rather spend that $500 and start using it right away. And as a bonus you get technical support if you run into any problems. Peter

                          A 1 Reply Last reply
                          0
                          • A Andreas Saurwein

                            Well, you describe one of the phenomenons on CP - have a good looking, blinking editcontrol which shows bitmaps in each typed character and you get a great rating, no matter how bad the code is. :) abc wrote: May be that's why popular articles on CodeProject do have to be useful, as long as they look good. I suppose that should read "...on CodeProject dont have to..." :~ As good as (some) of the articles of CM and MD are, there are others who write excellent articles too.


                            Off to in ~69 days

                            A Offline
                            A Offline
                            abc
                            wrote on last edited by
                            #32

                            Andreas Saurwein wrote: I suppose that should read "...on CodeProject dont have to... Thanks for the correction.

                            1 Reply Last reply
                            0
                            • P Peter Zajac

                              Common reasons why people switch from a ownerdrwa list view to a grid control are: 1. ease of use. 2. ease of customization on cell level. Often people want to add some display flexibility to your data (color, font, celltypes, etc.). 3. ability to display real time data. 4. foot print. For example Ultimate Grid (by Dundas) only adds around 100k to your application size! 5. performance. In many cases people need to show a data result that is 100's of thousands of rows, the a list view can be used for this but it is much simpler and faster to use a third party grid control that already has support for what you need. After all would you rather spend days developing your own implementation of the list view, or would you rather spend that $500 and start using it right away. And as a bonus you get technical support if you run into any problems. Peter

                              A Offline
                              A Offline
                              Andreas Saurwein
                              wrote on last edited by
                              #33

                              Peter Zajac wrote: 1. ease of use :omg: Any grid that I have seen so far makes it pretty difficult to use compared with a list/listview control. Naturally, because it adds a lot of functionality too. Peter Zajac wrote: 2. ease of customization on cell level. Often people want to add some display flexibility to your data (color, font, celltypes, etc.). X| When this is really, really, needed then it can be done really, really easily with the standard windows controls too. Peter Zajac wrote: 3. ability to display real time data. Ever heard of the "virtual" listview data? Peter Zajac wrote: 4. foot print. Standard windows controls: 0k Peter Zajac wrote: 5. performance. In many cases people need to show a data result that is 100's of thousands of rows, the a list view can be used for this but it is much simpler and faster to use a third party grid control that already has support for what you need. No grid control can possibly ever be faster than a normal list/listview control. And done right, a virtual listview control can show millions of records without any timing problems. So I rather keep that $500. :)


                              Off to in ~69 days

                              T 1 Reply Last reply
                              0
                              • A Andreas Saurwein

                                Nick Parker wrote: about any program that does a search and displays a list could use something like this Any program like this could also embed a Excel worksheet, just in case you need more functionality. :omg:


                                Off to in ~69 days

                                N Offline
                                N Offline
                                Nick Parker
                                wrote on last edited by
                                #34

                                Andreas Saurwein wrote: Any program like this could also embed a Excel worksheet, just in case you need more functionality. That assumes that your user has a lisence for Excel. -Nick Parker

                                A 1 Reply Last reply
                                0
                                • M MarkSh

                                  Clearly this passes for humour wherever you live :) Obviously when you only need a list and you have a small amount of read only data, then yes maybe you can manually add your items to a listview or listbox. But if you want any sort of complex databound list or an editable table, grids are your only choice. Then what about grouping, filtering available in commercial solutions all of which are necessary in commercial software. And whilst embedding an excel worksheet is an idea, again it is manual and very very slow - not to mention relying on excel being present....... :(

                                  A Offline
                                  A Offline
                                  Andreas Saurwein
                                  wrote on last edited by
                                  #35

                                  Well, it wasnt meant to be funny. The only and really only valid argument for a grid is the "editable table" which further may be refined as "editable table in every cell and easily navigateable". For every other use a grid is overkill. Grouping and filtering can be implemented very fine in any list/listview control and is even already available out-of-the-box in the latest common controls.


                                  Off to in ~69 days

                                  1 Reply Last reply
                                  0
                                  • N Nick Parker

                                    Andreas Saurwein wrote: Any program like this could also embed a Excel worksheet, just in case you need more functionality. That assumes that your user has a lisence for Excel. -Nick Parker

                                    A Offline
                                    A Offline
                                    Andreas Saurwein
                                    wrote on last edited by
                                    #36

                                    Nick Parker wrote: That assumes that your user has a lisence for Excel. :eek: What? Dont tell me you dont deliver a MS Office 12 licence with your product. :cool:


                                    Off to in ~69 days

                                    N 1 Reply Last reply
                                    0
                                    • A Andreas Saurwein

                                      Nick Parker wrote: That assumes that your user has a lisence for Excel. :eek: What? Dont tell me you dont deliver a MS Office 12 licence with your product. :cool:


                                      Off to in ~69 days

                                      N Offline
                                      N Offline
                                      Nick Parker
                                      wrote on last edited by
                                      #37

                                      Andreas Saurwein wrote: What? Dont tell me you dont deliver a MS Office 12 licence with your product. It's just the idea. ;) -Nick Parker

                                      1 Reply Last reply
                                      0
                                      • A Andreas Saurwein

                                        Ok, now it really makes more sense :) While I agree on your view of "generating forms programatically", I dont think that a grid control is yet the right choice for implementing it. (Probably I am only a listview control freak) In most cases I find it more complicated to eliminate unwanted features from a grid, than adding new features to a list control. Yes, I did try using a grid a few times, only once a grid actually made it into one of my applications and then only as a optional control in a form designer.


                                        Off to in ~69 days

                                        E Offline
                                        E Offline
                                        Ernest Laurentin
                                        wrote on last edited by
                                        #38

                                        I agree with you Andreas on that one! the LISTVIEW control is an excellent control. And no you are not the only listview control freak! ;P ÿFor the bread of God is he who comes down from heaven and gives life to the world. - John 6:33

                                        A 1 Reply Last reply
                                        0
                                        • A Andreas Saurwein

                                          Peter Zajac wrote: 1. ease of use :omg: Any grid that I have seen so far makes it pretty difficult to use compared with a list/listview control. Naturally, because it adds a lot of functionality too. Peter Zajac wrote: 2. ease of customization on cell level. Often people want to add some display flexibility to your data (color, font, celltypes, etc.). X| When this is really, really, needed then it can be done really, really easily with the standard windows controls too. Peter Zajac wrote: 3. ability to display real time data. Ever heard of the "virtual" listview data? Peter Zajac wrote: 4. foot print. Standard windows controls: 0k Peter Zajac wrote: 5. performance. In many cases people need to show a data result that is 100's of thousands of rows, the a list view can be used for this but it is much simpler and faster to use a third party grid control that already has support for what you need. No grid control can possibly ever be faster than a normal list/listview control. And done right, a virtual listview control can show millions of records without any timing problems. So I rather keep that $500. :)


                                          Off to in ~69 days

                                          T Offline
                                          T Offline
                                          Troy Marchand
                                          wrote on last edited by
                                          #39

                                          It is true that you could spend the time to make as many modifications to the listview control as you like. But the main point here is 'time'. With a full grid control all of the hard work has already been done. For example: How much time would it take you to add a masked edit field to a column within a listview? With a grid such as Ultimate Grid, it is a single line of code. Now, I am not saying that there is not a place for a listview control, but if you do need more capabilities than just showing a simple list then a grid control is much more cost effective.

                                          A 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