title: Delphi virtual TListView - icon remains selected even though the rest of the text is cleared
body: <p>I have a virtual TListView which has an TImageList assigned to it. The item.ImageIndex is set on the OnData event. The listview is read only and has RowSelect as true and is displaying in vsReport ViewStyle.</p>
  
  <p>When I select a row and then select a second row, the icon of the first row remains with the selected coloured background. If I move the mouse over it (so that the paler 'selectable' background appears) and then move the mouse off without selecting anything the background returns to white as normal.</p>
  
  <p>The bug seems to occur when setting the image via either smallImages/ImageIndex or StateImages/StateIndex</p>
  
  <p>Is this a known bug and are there any workarounds? I've tried putting a refresh event under OnSelectItem, though this appears to be buggy as when I'm passed the 'not selected' TListItem, the Item parameter is always nil (the 'selected' pass works fine, though, and both work for non-virtual mode).</p>
  
  <p>This is occurring in Delphi XE2, which is the latest version I have available. If it's still present in later versions then I can raise a bug report.</p>
  
  <p><a href="https://i.stack.imgur.com/vcBrY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vcBrY.png" alt="Image showing &#39;sticky&#39; selection"></a></p>
  
  <p>One other mitigating factor that may have some influence: The application is skinned using DevExpress skinning libraries. This shouldn't affect the OnSelectItem bug though.</p>
  
  <p>edit:
  Reproduced in a simple example of form with Listbox and a 1-icon imagelist on it, with the following code:</p>
  
  <pre><code>procedure TForm28.FormCreate(Sender: TObject);
  begin
    listview1.Items.Count := 5;
  end;
  
  procedure TForm28.ListView1Data(Sender: TObject; Item: TListItem);
  begin
    item.Caption := 'item #' + inttostr(item.Index);
    item.ImageIndex := 0;
  end;
  </code></pre>
  
  <p>Listbox set to defaults apart from setting SmallImages and OwnerData=true and ViewStyle = report</p>
  
  <p>With viewStyle as vsIcon I see a similar issue, with the selection highlight not being cleared 'high' enough leaving a blue border at the top of the item. </p>
  
  <p>I wonder if this is an issue with the Windows version where Windows changed the styling of the component but Delphi controls the area to redraw? I'm using Win 8 Pro on this machine.</p>