473,388 Members | 1,377 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,388 software developers and data experts.

Listview Column Header Autosize Bug ?

Hello,

Do you know why in the following code the result is a column of size 0 ?
(in the doc it says to use -2 to autosize column header...)

ColumnHeader MyColumnHeader = new ColumnHeader();
MyColumnHeader.Text = "col1";
MyColumnHeader.Width = -2; // if you remove this line col appears
MyListView.Columns.Add(MyColumnHeader);

ListViewItem MyItem = new ListViewItem("item 1",0);
MyItem.SubItems.Add("sub1");
MyItem.SubItems.Add("sub2");
MyListView.Items.Add(MyItem);
How to automatic adjust a column size to its content ?
(is the documentations faulty about "width" property ?)
Regards,
Cybertof.
Nov 15 '05 #1
1 7342
I found it :

Yes it is a referenced bug...

http://support.microsoft.com/default...b;en-us;316572

Cybertof.
Nov 15 '05 #2

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

Similar topics

0
by: m. pollack | last post by:
Hi all, I am using a Listview with three columns, and would like to center-align the column header text. When I try to do this at design time with the properties editor, it won't allow me to...
0
by: Richard | last post by:
Hi. How can I detect right-click on the ListView Column Headers? The click event doesn't do it. Thank you very much, Rick
1
by: Sam Martin | last post by:
hi all, anyone know how i can detect this i c#? tia sam martin
0
by: p19010101 | last post by:
Using sample codes from msdn and code snippets from this group, I am able to derive a custom listivew user control with column sorting and up/down icons in the column header. It works fine except...
0
by: Alan T | last post by:
I have create a settings file would like to apply to the listview column header. eg. I want to display the first column header read from the Settings file at design time. However, there is no...
2
by: Marco | last post by:
Is there a way to get the text in a column header to wrap to multiple lines? I'm using vb.net 2003.
3
by: djohnson | last post by:
My listview will sort but I would like the column headers to contain up or down arrows to indicate the sort direction. I have an image on the column header, but I'm having a heck of a time...
0
by: Jeff Gaines | last post by:
On 29/08/2008 in message <F58652AE-D036-4EF5-8078-36A60D90D0F3@microsoft.comEd Kramer wrote: There is a crude in-built sorter which will sort column 1 either ascending or descending - turn it...
0
by: palash909 | last post by:
Visual basic version(2008) How can i change the listview column header color and font size?? 1. Listview1 body font color is black 2.Font size 9 and style is regular ...
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: 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
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.