Closed GoogleCodeExporter closed 9 years ago
Did you create the custom column before calling your LoadItem method? e.g:
ImageListView1.Columns.Add(ColumnType.Custom, "My Group Column")
Otherwise can you please post the stack trace?
Thanks,
Ozgur
Original comment by oozcitak
on 30 Oct 2012 at 8:33
Hi,
Thanks for your help.
Yes, I had added the custom column and in fact it seems that this is what is
causing the problem. If I call SetSubItemText on a column that is a custom type
it throws an index out of range error. If the column type is set to something
else I seem to get no errors.
It is easy to replicate the error - Create a form, add an ImageListView object.
Add the following to the form's onload event:
Me.ImageListView1.Columns.Add(Manina.Windows.Forms.ColumnType.Custom, "My Column")
Me.ImageListView1.Items.Add("C:\Users\Quentin\Dropbox\My Pictures\200512221836_00039.jpg")
Me.ImageListView1.Items(0).SetSubItemText(0, "Blah")
When it is run an error occurs on and Items.Add method with the following stack
trace:
at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
at System.String.Substring(Int32 startIndex, Int32 length)
at Manina.Windows.Forms.Utility.GroupTextAlpha(String text)
at Manina.Windows.Forms.ImageListViewItem.UpdateGroup(ImageListViewColumnHeader column)
at Manina.Windows.Forms.ImageListView.ImageListViewItemCollection.Sort()
at Manina.Windows.Forms.ImageListView.ImageListViewItemCollection.AddRemoveGroupItem(Int32 index, Boolean add)
at Manina.Windows.Forms.ImageListView.ImageListViewItemCollection.InsertInternal(Int32 index, ImageListViewItem item, ImageListViewItemAdaptor adaptor)
at Manina.Windows.Forms.ImageListView.ImageListViewItemCollection.AddInternal(ImageListViewItem item, ImageListViewItemAdaptor adaptor)
at Manina.Windows.Forms.ImageListView.ImageListViewItemCollection.Add(ImageListViewItem item, ImageListViewItemAdaptor adaptor)
at Manina.Windows.Forms.ImageListView.ImageListViewItemCollection.Add(ImageListViewItem item)
at Manina.Windows.Forms.ImageListView.ImageListViewItemCollection.Add(String filename, Image initialThumbnail)
at Manina.Windows.Forms.ImageListView.ImageListViewItemCollection.Add(String filename)
at WindowsApplication1.Form1.Form1_Load(Object sender, EventArgs e) in C:\Users\Quentin\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb:line 4
Regards,
Quentin
Original comment by QuentinG...@gmail.com
on 30 Oct 2012 at 12:50
This issue was closed by revision r691.
Original comment by oozcitak
on 31 Oct 2012 at 10:31
Original issue reported on code.google.com by
QuentinG...@gmail.com
on 26 Oct 2012 at 1:43