zane.sims
Joined: 07 Aug 2007 Posts: 40
|
Posted: Sat Feb 28, 2009 11:57 am Post subject: ListView selection problem? |
|
|
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 _________________ わたしがプログラマだよ! |
|