×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Feb 2009
    Posts
    108

    Problem with Removing last item in listbox

    After I removed the last item in listbox, I called HandleItemRemoval() on listbox,
    But the result is unpleasant: that item is gone, but the current item index remains unchanged.
    So I can not see the highlight of current item(because that item is no longer there).

    More dangerous, some operations which operate on the current item will go into trouble because of this.

    How to get grid of incorrect current item index problem?

  2. #2
    Super Contributor
    Join Date
    Nov 2004
    Posts
    1,009

    Re: Problem with Removing last item in listbox

    After removing the last listbox item, call something like SetcurrentItemIndex(Count-1).

    It will set the index for last available item.

    Hope it will help.
    Regards,
    Shafali

  3. #3
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,692

    Re: Problem with Removing last item in listbox

    I do not know the current situation, but HandleItemRemoval was reported as a partially useful method in the past - exactly because of the issue you are facing.
    This is why Avkon supplies the really nice, AknListBoxUtils::HandleItemRemovalAndPositionHighlightL method.

  4. #4
    Regular Contributor
    Join Date
    Feb 2009
    Posts
    108

    Re: Problem with Removing last item in listbox

    Thank you both. I use AknListBoxUtils to solve this problem.

Similar Threads

  1. Listbox deletion problem with bottom item
    By gailu in forum Symbian
    Replies: 3
    Last Post: 2008-08-22, 11:47
  2. problem in ListBox
    By aditighosal in forum Symbian
    Replies: 8
    Last Post: 2008-07-16, 20:01
  3. Cannot read from listbox item array
    By Acemaker in forum Symbian
    Replies: 6
    Last Post: 2007-07-14, 17:43
  4. How to delete the last item in a listbox
    By zhang_guoqing in forum Symbian User Interface
    Replies: 1
    Last Post: 2003-07-21, 07:28
  5. A ListBox problem, well-skilled developer please help me
    By liuajie in forum Symbian User Interface
    Replies: 2
    Last Post: 2003-04-11, 09:58

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×