473,387 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

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
lvProdImg.items(0).text="img0"
lvProdImg.items(1).text="img1"
lvProdImg.items(2).text="img2"
lvProdImg.items(3).text="img3"

once it is reordered as
lvProdImg.items(0).text="img2"
lvProdImg.items(1).text="img0"
lvProdImg.items(2).text="img1"
lvProdImg.items(3).text="img3"

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)
srcitem.Remove()
End If
End If

End Sub
Jul 21 '05 #1
0 2489

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Kanaiya | last post by:
hello how to put images in either listbox or listview.bye. -- With regards, Gangani Kanaiya.
3
by: Rookie | last post by:
Hi, Is there any way I can keep an item in a ListView higlighted even when the ListView does not have focus. eg. If the user is modifying the row by entering values in a TextBox then the...
0
by: Al Findlay | last post by:
Hello! I have a listview which has a column of images. The problem is, I want to be able to align the images to the centre of the column. By default, the images always align to the left. Can...
1
by: rallard | last post by:
After the following subroutine executes, my listview shows a scroll bar on the right, but it is otherwise blank. I've checked for things like locked=false, visable=true, font color same as...
0
by: thomasp | last post by:
I have a 2 listviews on a windows form in my VB2005 applicaion. The first listview is populated by the columns from a database table when the form opens. The user can move items back and forth...
0
by: Hunters | last post by:
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...
3
by: Curtis | last post by:
I am trying to do a simple sort on a list view.With the listview control the first time I sort on the control it sorts the items but anytime after that it fails to sort. I'm sure this is a simple...
0
by: Jon Berry | last post by:
I would like to save the View state of a ListView. The only thing I have come up to get the current state is ListView1.View.ToString(); Then I save the string to a file and load it back in the...
4
by: Archimed | last post by:
Hi, I try to use an ImageList with a ListView but that don't work. I make a ListView in VirtualMode with LargeIcon view. I put the ImageList in the LargeImageList property. I add a bitmap...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.