I have an image list set on the list control and the only place I want
the image to appear is in the 4th column. But, like in the above post,
as soon as I assign the image list the icon is appearing in the very
first column.
I didn't have this problem on 2.8.11.0. Here is the code that I am
using to set data on my list:
index = 0
for key, data in items:
self.listctrl.InsertStringItem(index, data[0])
self.listctrl.SetStringItem(index, 1, data[1])
self.listctrl.SetStringItem(index, 2, data[2])
self.listctrl.SetStringItem(index, 3, data[3])
self.listctrl.SetItemColumnImage(index, 4, self.idx1)
self.listctrl.SetItemData(index, key)
index += 1
is there another way to fix this besides adding a "dummy" column as
Robin mentions in the above link?
There is no way to prevent the native listview widget from reserving space in the first column for an icon when an image list is assigned, but you can work around the bug where it is incorrectly using an icon there. You can either add another image to the image list which is transparent and use its idx for the first column, or it looks like using an image idx that does not exist in the image list (like 99) will also suppress it.
I have an image list set on the list control and the only place I want
the image to appear is in the 4th column. But, like in the above post,
as soon as I assign the image list the icon is appearing in the very
first column.
I didn't have this problem on 2.8.11.0. Here is the code that I am
using to set data on my list:
index = 0
for key, data in items:
self.listctrl.InsertStringItem(index, data[0])
self.listctrl.SetStringItem(index, 1, data[1])
self.listctrl.SetStringItem(index, 2, data[2])
self.listctrl.SetStringItem(index, 3, data[3])
self.listctrl.SetItemColumnImage(index, 4, self.idx1)
self.listctrl.SetItemData(index, key)
index += 1
is there another way to fix this besides adding a "dummy" column as
Robin mentions in the above link?