ListView.EnsureVisible near deleted item 
Author Message
 ListView.EnsureVisible near deleted item

Greetings all:

I am kinda new at this, and I inherited this application a few months ago.

I have a sorted ListView control whose collection of ListItems exceeds the
physical lower boundary of the control.  When a user manipulates an item in
the list that is beyond that boundary , I would like to keep the item
visible.  On MSDN I found out how to do that when I add an item, by using
the EnsureVisible property.  However, now I have a problem.

When deleting an item, I would like to EnsureVisible the item just after the
deleted item in the ListView if it exists, or the item just above it
otherwise, if it exists.  The collection is indexed by key, as opposed to
index, and the collection is not sorted but the ListView is.  An example of
the key is "CHAN24".  Is there an easier way to find out the key of the
immediately succeeding or preceding item in the ListView other than getting
the numeric portion of the deleted key with Val( ), and then adding or
subtracting from it, doing a bunch more type conversions etc., and checking
to see if that key even exists?  And if that is what I have to do, could
someone please tell me how to test for the existence of a key.  I know how
to set up the loop and all, but not how to simply check for the existence of
the key once inside the loop.

Thank you,
Clark



Wed, 18 Jun 1902 08:00:00 GMT  
 ListView.EnsureVisible near deleted item
Maybe diddle around with some x/y scaling off of HitTest???
Please post your stuff if this doesn't do the deed and post your
solution if it does!
Neila


Quote:
> Greetings all:

> I am kinda new at this, and I inherited this application a few months ago.

> I have a sorted ListView control whose collection of ListItems exceeds the
> physical lower boundary of the control.  When a user manipulates an item
in
> the list that is beyond that boundary , I would like to keep the item
> visible.  On MSDN I found out how to do that when I add an item, by using
> the EnsureVisible property.  However, now I have a problem.

> When deleting an item, I would like to EnsureVisible the item just after
the
> deleted item in the ListView if it exists, or the item just above it
> otherwise, if it exists.  The collection is indexed by key, as opposed to
> index, and the collection is not sorted but the ListView is.  An example
of
> the key is "CHAN24".  Is there an easier way to find out the key of the
> immediately succeeding or preceding item in the ListView other than
getting
> the numeric portion of the deleted key with Val( ), and then adding or
> subtracting from it, doing a bunch more type conversions etc., and
checking
> to see if that key even exists?  And if that is what I have to do, could
> someone please tell me how to test for the existence of a key.  I know how
> to set up the loop and all, but not how to simply check for the existence
of
> the key once inside the loop.

> Thank you,
> Clark



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Listview.Ensurevisible

2. Listview and ensurevisible

3. EnsureVisible and ListViews

4. Sorting ListView control, EnsureVisible problem

5. Repost: Deleting last listview item

6. Delete last Listview Item

7. How to iterate through and delete mutiple selected items from a listview

8. Delete Listview Item

9. Deleting ListView items

10. listview delete items?

11. Deleting ListView items

12. Delete multiple listview items?

 

 
Powered by phpBB® Forum Software