Listview and PropertyGrid on form

N

newbie

Hello,

I maybe asking too much in a single posting, but here it goes:

I building a windows form that mimic's the Outlook XP GUI. Its a three
pane form that will allow a user to view and edit records in a
database. A Treeview in the left pane, a Listview in the TopRight
Pane, and a PropertyGrid in the BottomRight; The Treeview will allow
the user to select an
"Entity" to view, the listview will display a list of instances of
that entity. The propertygrid will display the properties of the
instance(s) selected in the listview.

Barriers:

1) Can I add custom types to the listview control and having the
properties of the customtype appear as item\subitems ? I have seen
code were custom types inherit from ListViewItem, if this is the way
to add a custom type to the listview control, how doyou
populate\display the subitems? I am potentially displaying 20
different types(or collections of types) in the listview, do I need to
create a custom listviewitem for each of these types?

2) I can forsee having to create huge if\else or switch\case
statements to handle casting objects from one type to an other.
ListView Items to. I have read postings that suggestion creating an
interface that all custom types will implement, which then would
require you to cast only to the interface.
Are there c# examples of creating\implementing interfaces with GUI's,
I maybe asking too much .


I apologize if any of the questions are not clear or silly, this is my
first c# application, I have experience using c++Builder but I am new
to c#.

newbie
 
N

newbie

1) Can I add custom types to the listview control and having the
properties of the customtype appear as item\subitems ? I have seen
code were custom types inherit from ListViewItem, if this is the way
to add a custom type to the listview control, how doyou
populate\display the subitems? I am potentially displaying 20
different types(or collections of types) in the listview, do I need to
create a custom listviewitem for each of these types?

I used the tab property of the ListviewItem to hold my custom types. I
am creating a couple of interfaces that the classes will need to
implement. This should minimize casting. I will cast any object to the
required interface to accomplish the necessary tasks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top