Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor nadis's Avatar
    Join Date
    Feb 2009
    Posts
    108
    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 shafali gupta's Avatar
    Join Date
    Nov 2004
    Posts
    1,009
    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 wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    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 nadis's Avatar
    Join Date
    Feb 2009
    Posts
    108
    Thank you both. I use AknListBoxUtils to solve this problem.

Similar Threads

  1. Listbox deletion problem with bottom item
    By gailu in forum Symbian C++
    Replies: 3
    Last Post: 2008-08-22, 11:47
  2. problem in ListBox
    By aditighosal in forum Symbian C++
    Replies: 8
    Last Post: 2008-07-16, 20:01
  3. Cannot read from listbox item array
    By Acemaker in forum Symbian C++
    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
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved