Re: Saving Listview Selected Item Problems
- From: "JP Bless" <jp3BlessNoSpam@xxxxxxxxxxx>
- Date: Sun, 9 Sep 2007 20:49:51 -0400
Some sort of "hack" solution. If you are reading data from some table and
the records have unique (record) number... if the user does not need to see
the unique record then create an extra listview column with 0 column width.
When your app close you save the unique number of the last selected item.
When your app open you use code like the one below to select the last Item
For Each itmx in YourListView
If YourUniqueNumber = HiddenColumnData then
'Set as selected Item... put selected Item code here
Exit for
End if
Next
"Saucer Man" <saucerman@xxxxxxxxxx> wrote in message
news:aU%Ei.87302$jH3.286@xxxxxxxxxxxxxxxxxxxxxxxxx
Can you explain about these "unique record numbers" and how to use them?
--
Thanks.
"JP Bless" <jp3BlessNoSpam@xxxxxxxxxxx> wrote in message
news:eoOiZvz8HHA.748@xxxxxxxxxxxxxxxxxxxxxxx
Better to use unique record number instead of index of listview.
"Saucer Man" <saucerman@xxxxxxxxxx> wrote in message
news:l7ZEi.60134$Lu.40473@xxxxxxxxxxxxxxxxxxxxxxxxx
When I exit my app, I save the listview selected item index in a text
file. When I open the app, I retrieve this index and select the item
again in the listview. This is working sporatically. Sometimes when I
click on a different column in the listview to change the sorting, if I
close my app and re-open it, I have a different item in the listview
selected. Othertimes when I do this it works fine. I am also saving the
sort key and sort order. How can I make it so that no matter what
column is sorted, the same item in the listview is retrieved when the
app is opened?
--
Thanks.
.
- Follow-Ups:
- Re: Saving Listview Selected Item Problems
- From: Dave O.
- Re: Saving Listview Selected Item Problems
- References:
- Saving Listview Selected Item Problems
- From: Saucer Man
- Re: Saving Listview Selected Item Problems
- From: JP Bless
- Re: Saving Listview Selected Item Problems
- From: Saucer Man
- Saving Listview Selected Item Problems
- Prev by Date: Re: Saving Listview Selected Item Problems
- Next by Date: Re: How to pass object from dll to exe? error <98>
- Previous by thread: Re: Saving Listview Selected Item Problems
- Next by thread: Re: Saving Listview Selected Item Problems
- Index(es):
Relevant Pages
|