Hi everyone,
After reading various posts I'm still scratching my head and unsure of what
approach to take. I have created buttons that upon clicking, the buttons add
an item name (myName) to my ListView (lvBody) and at the same time, also add
subitems(unitPrice);
The problems is that if I don't have sort going on, then all "subitems" are
fine. If I have sorting, then the "subitems" that are being placed above the
last Alpha "subitems" info are being lost, and just the first entry and
lowest entry "subitems are being displayed, sample output ie:
UnSorted
Tuna Sand $7.95
ClubHouse $8.95
Wild Oysters $24.95
BLT $6.95
Sorted
BLT
ClubHouse
Tuna Sand $7.95
Wild Oysters $24.95
--------------------
My syntax is as follows:
this.lvBody.Sorting = SortOrder.Ascending; //Sort ListView in Ascending
Order
string unitPrice = System.String.Format("(0:C)", myPrice);
this.lvBody.BeginUpdate();
this.lvBody.Items.Add(myName);
this.lvBody.Items.[ListViewCounter].SubItems.Add(unitPrice.ToString());
this.lvBody.EndUpdate();
ListViewCounter += 1; //increments counter by 1
Now I'm unsure if I should manually sort the ListView every time an item is
added, ICompare, sort in a Collection, etc, etc. Any and all help is truly
appreciated.
MikeY