FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ListView selection problem?

 
Post new topic   Reply to topic     Forum Index -> DFL
View previous topic :: View next topic  
Author Message
zane.sims



Joined: 07 Aug 2007
Posts: 40

PostPosted: Sat Feb 28, 2009 11:57 am    Post subject: ListView selection problem? Reply with quote

Sorry, but I have another question. This time about the ListView control. I derived a class from a ListView and am trying to select the item with:

Code:
module framelistview;

import dfl.all;

class FrameListView : ListView
{
   this()
   {
      this.allowColumnReorder = false;
      this.fullRowSelect = true;
      this.hideSelection = false;
      this.hoverSelection = false;
      this.multiSelect = false;
      this.scrollable = true;
      this.gridLines = true;
      this.view = View.DETAILS;
      this.activation = ItemActivation.STANDARD;
            
      ColumnHeader col;
      
      col = new ColumnHeader;
      col.text = "Frame";
      col.width = 100;
      this.columns.add(col);
      
      col = new ColumnHeader;
      col.text = "Delay";
      col.width = 50;
      this.columns.add(col);
   }
   
   public void addFrame(char[] filename)
   {   
      this.items.add(filename);
      
      this.items[this.items.length - 1].subItems.add("0");
            
      this.items[this.items.length - 1].selected = true;
   }
}


What I am trying to do is auto select an item as it is added to my custom ListView. The problem is that the item is not highlighted when I do this. If I attach a "selectedIndexChanged" Event, it does fire after calling addFrame, but still the item is not highlighted. Perhaps selecting and highlighting are handled differently. If so, how do I get the selected item to highlight?

Thanks in advance,
Zane
_________________
わたしがプログラマだよ!
Back to top
View user's profile Send private message
Chris Miller



Joined: 27 Mar 2004
Posts: 514
Location: The Internet

PostPosted: Tue Mar 03, 2009 7:30 pm    Post subject: Re: ListView selection problem? Reply with quote

It works for me as long as the selection is set after the control's handle is created.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> DFL All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group