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