ListView and User Control

Ice725

Freshman
Joined
Apr 19, 2004
Messages
31
I have a User Control that reads Customers from a XML file and displays their information in a ListView. I have added the User Control to a Windows Form and it works fine.

But now I wish to grab the Customer name (SubItems[0], or the first column) from the ListView Control when a ListViewItem is clicked/changed, and display it in a Label on the Windows Form.

How should I go about doing this?
 
Your user control could raise events that pass the relevant data. In the listview's SelectedIndexChanged event handler, you could raise your own event. (If you don't know how to implement events, check the MSDN.)
 
Back
Top