473,888 Members | 1,616 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Listview Column Header Autosize Bug ?


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 ?)
Nov 15 '05 #1
1 7363
I found it :

Yes it is a referenced bug...


Nov 15 '05 #2

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

Similar topics

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?
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
by: Sam Martin | last post by:
hi all, anyone know how i can detect this i c#? tia sam martin
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...
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.
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.
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...
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.
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---------------------------------------
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
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,...
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...
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,...
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...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
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...
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: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.