I am looking to create an editable ListView in a C# winforms application where a user may double click on a cell in order to change its contents. It would be great if someone could provide my with some guidance and/or an example. I am not looking to use any commercial products.
+3
A:
You're asking the wrong question :)
A ListView is not the correct control. Use the DataGridView control. It can be configured to look just like a ListView, but it supports in-place editing of cells.
Simon Gillbee
2009-04-30 19:20:53
That's a matter of opinion. The DataGridView doesn't always fit the use scenario or provide the required look-and-feel. However, it is a possible alternative, depending on the goals of the OP.
Jeff Yates
2009-04-30 19:33:42
A:
From the sounds of it, you might want to consider using the DataGridView instead.
jblaske
2009-04-30 19:22:53
This is a WPF article. Is that what is desired, or are we looking at straight WinForms here? The tags indicate WinForms.
Simon Gillbee
2009-04-30 20:07:21
+2
A:
An ObjectListView will do exactly that and much more. It is a wrapper around a normal .NET ListView. It is open source.
Its website has a Getting Started to help you begin, as well as a whole page devoted to cell editing
Grammarian
2009-05-13 07:04:43
Thanks for your response. This custom control looks interesting, but may be overkill for what I'm trying to do. I shall experiment with it nonetheless.
transmogrify
2009-05-13 15:41:38
Actually, it's not a custom control really. It's just a helpful wrapper around a plain ListView. But we won't tell anyone that :)
Grammarian
2009-05-16 18:04:22