473,670 Members | 2,447 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Colu mns.Add(MyColum nHeader);

ListViewItem MyItem = new ListViewItem("i tem 1",0);
MyItem.SubItems .Add("sub1");
MyItem.SubItems .Add("sub2");
MyListView.Item s.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 7356
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
1306
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 set the leftmost column to center alignment -- it just snaps back to "left". I have tried overriding this in the C# code itself, but nothing works -- the leftmost column header's text is always left-aligned. Is this a bug? Am I missing something?
0
1368
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
5627
by: Sam Martin | last post by:
hi all, anyone know how i can detect this i c#? tia sam martin
0
1627
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 one small problem. Say column 1 reads "company name", when I click on the header it becomes "company..." with an up icon on the right indicating the column is sorted in ascending order. When I click on the 2nd column, the code removes the icon...
0
1102
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 property of column I can read from the settings file.
2
5191
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
2558
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 figuring out how to programmatically change it. I can't find the property. Someone suggested it is impossible to change the column header index in .Net and that native Win32 API calls have to be used. Is this true? Isn't there a more straightforward...
0
1109
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 on with the sorting property. You are much better off rolling your own to take account of the different data types the LV may contain, you can also use it to set the sort icons.
0
3085
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 ---------------------------------------Column Header---------------------------------------
0
8386
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8814
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8592
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8661
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7419
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5684
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4211
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4391
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2800
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.