By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,061 Members | 1,523 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,061 IT Pros & Developers. It's quick & easy.

Is it a bug? Listview's largeicon(so is smallicon) does not follow the order of list or detail view

P: n/a
Once you reorder the listview items, largeicon or smallicon view will not follow the order of list or detail view which is the correct order. For example with a listview as

once it is reordered as

the largeicon and smallicon view will be out of order while list and detail view is correct. Here is how i reorder items through drag and drop

Private Sub lvProdImg_ItemDrag(ByVal sender As Object, ByVal e As System.Windows.Forms.ItemDragEventArgs) Handles lvProdImg.ItemDrag
DoDragDrop(e.Item, DragDropEffects.Move)
End Sub

Private Sub lvProdImg_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles lvProdImg.DragEnter
e.Effect = DragDropEffects.Move
End Sub

Private Sub lvProdImg_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles lvProdImg.DragDrop
Dim lvitem, srcitem As ListViewItem
Dim destlv As ListView = CType(sender, System.Windows.Forms.ListView)

Dim clX, clY As Integer
If e.Data.GetDataPresent("System.Windows.Forms.ListVi ewItem", False) Then

srcitem = CType(e.Data.GetData("System.Windows.Forms.ListVie wItem"), ListViewItem)
clX = destlv.PointToClient(New Point(e.X, e.Y)).X
clY = destlv.PointToClient(New Point(e.X, e.Y)).Y

lvitem = destlv.GetItemAt(clX, clY)
If Not lvitem Is Nothing Then
destlv.Items.Insert(lvitem.Index, srcitem.Clone)
End If
End If

End Sub
Jul 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.