views:

194

answers:

2

say in my ListView say with 4 columns (Description, Price Per Unit, Quantity, Total Price).

I would like to make the third column editable, and embedded NumericUpDown control for the Quantity column. Is it possible? And when the Quantity is updated via the NumericUpDown control, the Total Price is also being updated based on Total Price = Quantity * Price Per Unit.

is the above achievable?

any code samples would be greatly appreciated.

A: 

I haven't tried but I can't think of any reason why it wouldn't be possible.

This knowledge base article (KB320344) shows how to add a combobox and you should be able to adapt the code for most other kinds of controls:
http://support.microsoft.com/kb/320344

ho1
that sounds great. It seems a very good link, thanks. I read in other posting that this kind of work is not easy. I will give a try.
on the above link you gave, I try to do the first portion of Create the Inherited ListView Control. However, it fails at theprotected override void Dispose(bool disposing)No suitable method found to override.Would you mind help to take a look?
Have you created your own class that inherits from the Listview and put the Dispose method in that class? The ListView class does have a Dispose method so it should be able to override that.
ho1
I am not sure how to create my own class that inherits from the ListView. Could you guide me, please?
Just follow along in the sample in the link. You'll have to do the whole of step 4 at the same time, if you only do bits of it it'll probably not build.Specifically, to inherit from listview it's the line:public class MyListView : System.Windows.Forms.ListView
ho1
A: 

would ObjectListView be useful for my needs?

http://objectlistview.sourceforge.net/cs/index.html