How to Delete selected Item from Markable ListBox?

Login to reply to this topic.
Tue, 2006-05-30 14:27
Joined: 2006-05-09
Forum posts: 16
I list out some message in a Markable Listbox
And I tried to delete those message I have selected

The message was dissappeared but The data on the Listbox items were still there

How can I delete the releate item with the message?

Could somebody show me a code to do that?

Tue, 2006-05-30 16:58
Joined: 2005-06-14
Forum posts: 81
Re: How to Delete selected Item from Markable ListBox?
Hi,

After deleting, you have to refresh the list :

Code:
  // Refresh the listbox due to model change
  iListBox->HandleItemAdditionL();

  iListBox->DrawNow();


Hope it will help you.

Bernie
Wed, 2006-05-31 07:44
Joined: 2005-12-14
Forum posts: 16
Re: How to Delete selected Item from Markable ListBox?
Hi,

This is the code that i have used to delete a selected item oto delete ,hope it will work for u

void CView8Container::DeleteSelectedL()
   {
   if (iBrookerListBox)
      {
      CTextListBoxModel* model = iBrookerListBox->Model();
      
      if (model->NumberOfItems() > 0)
         {
         CDesCArray* itemArray = STATIC_CAST(CDesCArray*, model->ItemTextArray());
         
         TInt currentItem = iBrookerListBox->CurrentItemIndex();
         itemArray->Delete(currentItem);
         
         AknListBoxUtils::HandleItemRemovalAndPositionHighlightL(
            iBrookerListBox,
            currentItem,
            ETrue);
                  
         }
      }
   
   }

Kishore

  • Login to reply to this topic.