Hi ,
Can anybody help me with embedding controls in the listview. I need to add button controls as subitem of listview. thanks
Hi ,
Can anybody help me with embedding controls in the listview. I need to add button controls as subitem of listview. thanks
There is a similar question on stackoverflow Adding button into a Listview in WinForms and the first recommendation is a codeproject article: Embedding Controls in a ListView
Well, you could be talking about the Windows Forms ListView, in which case you're pretty much SOL (sh*t outta luck.) You can custom draw on the ListView but even that has limitations in Windows Forms.
Or you could be talking about the Windows Presentation Foundation ListView. In this case it's really quite simple. You can create a DataTemplate that you associate with the ListView's columnn. Here's an example.
Or finally you could be talking about the ASP.NET ListView control which also has data templating support but the implementation is a bit different from WPF. Here's an example of that.
Use ObjectListView control which is opensource. It is excellent and is derived from ListView in Window.Forms.
If you can use another control instead of a listview, try the DataGridView - you can add any type of control to a cell (subitem). http://msdn.microsoft.com/en-us/library/e0ywh3cz.aspx