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. How to use a GridView in a ListView - C# WinForms

How to use a GridView in a ListView - C# WinForms

Scheduled Pinned Locked Moved C#
csharpwpfwinformswcfregex
5 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
    ramz_g
    wrote on last edited by
    #1

    Hi, I am working on a project where I have used a ListView to add and clear items. However, due to frequent adding and deleting, the ListView is being hard to maintain. So I thought of binding items to the ListView. Since it is not possible to bind an object to a ListView straight away, I was advised to use a GridView in a ListView and bind items to the GridView. I googled it to some extent, but I couldn't find an apt match. Can anyone post a link which might explain me what to do to use a bound GridView in a ListView? I'm using WinForms, not WPF... Thanks in Advance, ramz_g

    D 1 Reply Last reply
    0
    • R ramz_g

      Hi, I am working on a project where I have used a ListView to add and clear items. However, due to frequent adding and deleting, the ListView is being hard to maintain. So I thought of binding items to the ListView. Since it is not possible to bind an object to a ListView straight away, I was advised to use a GridView in a ListView and bind items to the GridView. I googled it to some extent, but I couldn't find an apt match. Can anyone post a link which might explain me what to do to use a bound GridView in a ListView? I'm using WinForms, not WPF... Thanks in Advance, ramz_g

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      A quick Google for "bindable ListView" came up with an article here on CP[^], along with a bunch of others all over the web.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008

      R 1 Reply Last reply
      0
      • D Dave Kreskowiak

        A quick Google for "bindable ListView" came up with an article here on CP[^], along with a bunch of others all over the web.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008

        R Offline
        R Offline
        ramz_g
        wrote on last edited by
        #3

        Hi Dave, Thanks a lot for your reply.. I have already analyzed the example project that you had posted a link to.. It doesn't suit my requirement because the example loops through a table and updates the ListView. That is exactly what I'm doing right now, just that I do not use a table but I iterate using a list of objects. But my case is that I add a huge number of items to the ListView at a moment, probably in the range of a few 1000's. That time, the performance of the ListView is not very pleasing. So, a pure DataBinding concept, as in the case of a DataGridView would be really helpful. I was told that a GridView in a ListView might serve this cause. Any opinions on this would be really helpful. Thanks in Advance, ramz_g

        H 1 Reply Last reply
        0
        • R ramz_g

          Hi Dave, Thanks a lot for your reply.. I have already analyzed the example project that you had posted a link to.. It doesn't suit my requirement because the example loops through a table and updates the ListView. That is exactly what I'm doing right now, just that I do not use a table but I iterate using a list of objects. But my case is that I add a huge number of items to the ListView at a moment, probably in the range of a few 1000's. That time, the performance of the ListView is not very pleasing. So, a pure DataBinding concept, as in the case of a DataGridView would be really helpful. I was told that a GridView in a ListView might serve this cause. Any opinions on this would be really helpful. Thanks in Advance, ramz_g

          H Offline
          H Offline
          Henry Minute
          wrote on last edited by
          #4

          AFAIK it would be enormously difficult to put a gridview in a listview. Why not simply use a DataGridView?

          Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

          R 1 Reply Last reply
          0
          • H Henry Minute

            AFAIK it would be enormously difficult to put a gridview in a listview. Why not simply use a DataGridView?

            Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

            R Offline
            R Offline
            ramz_g
            wrote on last edited by
            #5

            Hi Henry, Thanks for your reply. Using the DataGridView was always one the options that I had. Maybe its time that I zeroed-in on using the DataGridView... Thanks, ramz_g

            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