TopItem & ListView [Win C#]

M

MikeY

Hi Everyone,

I am trying to ensure displayed items at the top most portion of my ListView
when being added to my ListView, no matter where the items are being added
with in the listview. So that the users can easily find where their added
items are located. Can this be accompished with "TopItem"??? My code is as
follows:

foreach(ListViewItem ListView_Item in this.lvBody.Items)
{
if(listViewItem.Text ==
ListView_Item.ListView.Items[Loop_Counter].SubItems[0].Text)
{
//Ensure that Scroll always has focus for last item
this.lvBody.EnsureVisible(Convert.ToInt32(Loop_Counter));
//????
ListView_Item.ListView.Top.SubItems[0].ResetStyle();
}
Loop_Counter += 1;
}

Hopefully there is a solution for this. Any and all hellp is appreciated.

MikeY
 
C

Chan Ming Man

You might want to use 2 Listview to do it, one with hierarchy and another
one without.

chanmm
 

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