Help: Owner Drawn ListView

  • Thread starter Thread starter David Elliott
  • Start date Start date
D

David Elliott

I am looking for a good article on owner drawn listviews and have not been successful.

I have a class
bool
bool
bool
bool
string
string

I would like ALL the bools to show as graphical checkmark or a checkbox. I am looking to
click the field and change it from checked to unchecked at runtime.

As I have not created or derived controls before, any articles or code would be appreciated.

I am NOT looking to use a DataGrid.

Thanks,
Dave

(e-mail address removed)
 
Hi David,

Check out www.codeproject.com - they have an excellent article on
owner-drawn listviews (Sorted List View was in its name as far as I
remember). I have worked on a very similar task, and the only thing I could
not get over was that focus rectangle (the one drawn in dotted line) was
drawn only over non-custom-drawn columns. What was more interesting, the
rectangle looked OK - there was no missing borders or something. So I assume
as Windows Forms perform some custom drawing anyway, the standard ListView
drawing code probably stops drawing the focus rect once it sees a
custom-drawn column.
 
I looked throught the listview projects on codeproject already. Didn't see what I was
looking for.

I found several references on other sites to a project created by Carlos Perez that
was suppose to be on codeproject but have not found it.

Any chance you have the original project you are talking about stashed somewhere?

Thanks,
Dave

(e-mail address removed)
 
the one carlos wrote was taken down after he went
commercial and started selling components (something I
entirely support).

I wrote the 'c# listview' on codeproject and I'm getting
ready to post a newer version that contains embedding,
better sorting, bug fixes etc. this month.

-----Original Message-----
I looked throught the listview projects on codeproject already. Didn't see what I was
looking for.

I found several references on other sites to a project created by Carlos Perez that
was suppose to be on codeproject but have not found it.

Any chance you have the original project you are talking about stashed somewhere?

Thanks,
Dave

(e-mail address removed)
 
I pulled your project and briefly ran through it. The approach that you took was to
create a custom control.
public class GlacialList : System.Windows.Forms.Control

I wasn't intending to dive that deep. I am looking to understand and create it my self.
I was looking for more of a inherit and modify solution. Of course now I have an
example of how to create a custom control in the future when I get there.

Thanks for your help, but I am going to keep looking for something more along my
level.

Cheers,
Dave
 
no problem. I too started with taking the stock listview
and inheriting and changing it. The reason I went
entirely owner draw was because it was so painful to
modify the stock listview. heh

I learned a lot about listviews doing it so if I can be
of any help just ask.

good luck!
Allen Anderson
http://www.glacialcomponents.com

-----Original Message-----
I pulled your project and briefly ran through it. The approach that you took was to
create a custom control.
public class GlacialList : System.Windows.Forms.Control

I wasn't intending to dive that deep. I am looking to
understand and create it my self.
I was looking for more of a inherit and modify
solution. Of course now I have an
example of how to create a custom control in the future when I get there.

Thanks for your help, but I am going to keep looking for something more along my
level.

Cheers,
Dave
 
Back
Top