Search - Articles
DevASP.NET for ASP.NET, VB.NET, XML and C# (C-Sharp) Developers Saturday, December 16, 2017

Dev Articles
Search Directory
ASP.NET
VB.Net
C-Sharp
SQL Server
 


Home > Search > Knowledge Base > Visual Basic.Net > Errors and Bugs > VB.NET BUG
BUG: ListView.ColumnHeaderCollection.Add Method Does Not Work with Autosize Width in Visual Basic        
Total Hits: 471  |  Today: 0       Rating:  
Read Reviews | Write Review | Your Rating: 

When you pass -1 or -2 autosize width settings to the ListView.ColumnHeaderCollection.Add method, the ListView control does not display the column as expected.You expect a -1 setting to set the column header to the size of the largest subitem text in the column, and a -2 setting to set the column header to the size of the text in the column header. To work around this issue, avoid using the -1 and -2 autosize parameters. Instead, pass a predefined column width to the Add() method.The other available workaround is more involved. The following steps demonstrate how to implement the -1 setting by setting the column width after the column has been created, and how to implement the -2 setting by using GDI+ to measure the string size of the column header text and the subitem text (in pixels).


What's New at DevASP.Net
04/23  A Debug Stopwatch
04/23  The virtual bool bug
04/23  Application.EnableVisualStyles Bu..
04/23  The Process Async Reader Bug
04/23  Load a DBF into a DataTable
04/23  Weird Error: Unable to Validate D..
04/23  ASP.NET and jQuery to the Max
04/23  Fixing Error: "SetConfigurationSe..
04/23  Generics in .NET
04/23  Builder Design Pattern
04/23  Abstract Factory Design Pattern
04/23  Prototype Design Pattern
04/23  Bridge Design Pattern
04/23  Composite Design Pattern
04/23  Decorator Design Pattern
04/23  Validation in .NET Framework 4
04/23  Windows Phone 7: How to Encrypt C..
04/23  Text box to accept only number
04/23  Using the Raw Input API to Proces..
04/23  Study EVM (Earned Value Managemen..

DevASP.Net - Disclaimer - Privacy
2002-2010 DevASP.net