Hi,
I want to use the ListView like a CheckedListBox (Basic Winforms Controls). I want to save objects (i.e "Person") in the values and display the Name field/property on an item.
Example Code:
I need something like:
InfraListView.Items.Add( person1, "John")InfraListView.Items.Add( person2, "Karl")InfraListView.Items.Add( person3, "Charlie")
And when the user checks some item, I need to retrieve the object (in this case, a person object).
How can I do that? I knew that the ListView does not support binding.
Best regards,
Diego
InfraListView.View = UltraListViewStyle.List;InfraListView.ViewSettingsList.MultiColumn = false;InfraListView.ViewSettingsList.CheckBoxStyle = CheckBoxStyle.CheckBox;InfraListView.ItemCheckStateChanged += new ItemCheckStateChangedEventHandler( this.OnItemCheckStateChanged );
Hi Brian,
Thanks for your answer but this is not my problem.
My problem is how to save objects inside the items of a ListView. And then retrieve these objects.
Thanks,
I'm not sure I understand what you are looking for but UltraListViewItem exposes a Tag property, which is of type object and can be used to store additional data associated with that item.