This is the bulk of the procedure which populates the ListView:
ListViewItem lvi = new ListViewItem();
lvi.SubItems.Add(fileName);
lvi.SubItems.Add(FileName);
lvi.ImageIndex = 0;
lvi.StateImageIndex = 0;
lvi.ToolTipText = fileName;
//Prevent duplicate items adding.
if (lvExportedCards.Items.Count == 0)
{
lvExportedCards.Items.Add(lvi);
}
else
{
foreach (ListViewItem x in lvExportedCards.Items)
{
if (x.ToolTipText == lvi.ToolTipText)
{
break;
}
else
{
lvExportedCards.Items.Add(lvi);
}
}
}
And this is the code on the DoubleClick event:
foreach (ListViewItem d in
lvExportedCards.SelectedItems)
{
SessionData.AddData("CurrentBudgetCard", d.SubItems
[2].Text);
LoadBudgetCard(d.SubItems[2].Text);
}
On Sep 15, 3:56 pm, Andrew Badera <[email protected]> wrote:
> Show us your code.
>
> ∞ Andy Badera
> ∞ +1 518-641-1280
> ∞ This email is: [ ] bloggable [x] ask first [ ] private
> ∞ Google me:http://www.google.com/search?q=andrew%20badera
>
>
>
> On Tue, Sep 15, 2009 at 7:15 AM, Jarppi <[email protected]> wrote:
>
> > Hi All
> > I have a ListView on a Windows form, in Details view I've got an
> > SmallImageList bound to the control, and the icons show up fine.
> > However, when I select the item, the icon disappears!! When I deselect
> > it, it's back. So I thought it may have something to do with
> > StateImages, but after adding a StateImageList, and specifying a
> > stateimageindex on my ListViewItem, still nothing! It's driving me
> > crazy, can anyone help?
>
> > Thanks.