Hi!
I've recently upgraded my project to use ObjectListView and it's been amazing... but I cannot figure out how to do the following:
Is it possible to add a List of objects to a group? I have 3 different List<T> lists I want to add to the listview, each under their own group.
For instance see my code below:
// Get the 3 lists List<SCIXAccount> scixNames = usearch.FindAccounts(SCIXSearchType.Name, txtSearch.Text.ToUpper()); List<SCIXAccount> scixInitials = usearch.FindAccounts(SCIXSearchType.Initials, txtSearch.Text.ToUpper()); List<SCIXAccount> scixSalesID = usearch.FindAccounts(SCIXSearchType.SalesID, txtSearch.Text.ToUpper());
After that I'd like to have 3 groups in the ObjectListView (Name, Initals, and SalesID) and then do something like this:
lvSCIX.Groups["name"].Items.Add(scixNames) lvSCIX.Groups["Initials"].Items.Add(scixInitials) lvSCIX.Groups["salesID"].Items.Add(scixSalesID)
And each group would contain every item from that list.
Here is how I did I did it with a normal listview, but I can't seem to figure it out with an ObjectListView:
ListViewItem lvItem = lvSTORISSearch.Items.Add(p.Name); lvItem.SubItems.Add(p.Initals); lvItem.SubItems.Add(p.SalesID); lvItem.SubItems.Add(p.Type); lvItem.Group = lvSTORISSearch.Groups["name"];
ListViewItem lvItem = lvSTORISSearch.Items.Add(p.Name);
lvItem.SubItems.Add(p.Initals); lvItem.SubItems.Add(p.SalesID); lvItem.SubItems.Add(p.Type); lvItem.Group = lvSTORISSearch.Groups["name"];
Did you figure this out in the end?
If not, you might want to read this bit of the "Getting Started" guide: http://objectlistview.sourceforge.net/cs/gettingStarted.html#grouping
Log in to post a comment.
Hi!
I've recently upgraded my project to use ObjectListView and it's been amazing... but I cannot figure out how to do the following:
Is it possible to add a List of objects to a group? I have 3 different List<T> lists I want to add to the listview, each under their own group.
For instance see my code below:
After that I'd like to have 3 groups in the ObjectListView (Name, Initals, and SalesID) and then do something like this:
And each group would contain every item from that list.
Here is how I did I did it with a normal listview, but I can't seem to figure it out with an ObjectListView:
Did you figure this out in the end?
If not, you might want to read this bit of the "Getting Started" guide: http://objectlistview.sourceforge.net/cs/gettingStarted.html#grouping