New SP2 ListView bug

T

Tim

I have a custom control that uses a ListView control in it. It worked as
expected until SP2. Now with SP2, the left-most visible (width > 0) column's
width is displaying much too wide, for no apparent reason.

Scenario:
ListView Column 1 width set to 0 (I hide the first col)
Column 2 width set to -2 (auto-size col width to header text width), column
header text set to "Name"
Column 3 width set to -2, column header text set to "Gender Id"

With SP1, the first col was hidden, the second and third column widths were
sized to the width of the column headers, as the -2 value is supposed to do.

With SP2, the first col was hidden, the second column was about 3 times the
width of its column header value (which is "Name") and third column width
was normal (sized correctly to the header value width).

I took the same code and ran it on a device that still had only SP1 on it.
The results were back to normal, the columns with -2 as their width
property, were sized correctly to the width of the headers.

Conclusion:
It seems to only affect the left-most visible column. If the left-most
column is set to width = 0, then the next column to the right, set to -2
width, will display too wide (way too wide). The columns following that, set
to -2 width, will display correctly.

If the first column's width property is set to -2, then that column displays
too wide, and subsequent columns set to -2 display predictably.

Does anyone else see this behavior? Can Microsoft look into this?

Thanks,
Tim
 
K

Katie Schaeffer [MSFT]

Hi Tim,

I'd like to take a look at your problem...could you post some repro code.
I tried the code posted below (designer generated) with SP2 on a PPC 2003
image and I'm not seeing any issue. Could you share more information such
as what device you're using and the order you're modifying and inserting
the column headers?

Thanks,
-Katie

This posting is provided "AS IS" with no warranties, and confers no rights.

***.Net Compact Framework Info***
Faq:
http://msdn.microsoft.com/mobility/prodtechinfo/devtools/netcf/FAQ/default.a
spx
QuickStarts: http://samples.gotdotnet.com/quickstart/CompactFramework/
Samples:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/h
tml/CompactfxTechArt.asp

private void InitializeComponent()
{
this.mainMenu1 = new System.Windows.Forms.MainMenu();
this.listView1 = new System.Windows.Forms.ListView();
this.col1 = new System.Windows.Forms.ColumnHeader();
this.col2 = new System.Windows.Forms.ColumnHeader();
this.col3 = new System.Windows.Forms.ColumnHeader();
//
// listView1
//
this.listView1.Columns.Add(this.col1);
this.listView1.Columns.Add(this.col2);
this.listView1.Columns.Add(this.col3);
this.listView1.Location = new System.Drawing.Point(32, 32);
this.listView1.Size = new System.Drawing.Size(192, 176);
this.listView1.View = System.Windows.Forms.View.Details;
this.listView1.SelectedIndexChanged += new
System.EventHandler(this.listView1_SelectedIndexChanged);
//
// col1
//
this.col1.Text = "Hidden";
this.col1.Width = 0;
//
// col2
//
this.col2.Text = "Name";
this.col2.Width = -2;
//
// col3
//
this.col3.Text = "Gender ID";
this.col3.Width = -2;
//
// Form1
//
this.Controls.Add(this.listView1);
this.Menu = this.mainMenu1;
this.Text = "Form1";

}

--------------------
| NNTP-Posting-Date: Thu, 18 Dec 2003 11:40:57 -0600
| From: "Tim" <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| Subject: New SP2 ListView bug
| Date: Thu, 18 Dec 2003 11:41:33 -0600
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Lines: 37
| NNTP-Posting-Host: 207.207.51.92
| X-Trace:
sv3-tZw86HVlwRTXFHbRt8/p2N6kMhjlJ0pSapCGyKX6R6XcPikShzQag8/DYl7mEjuhynHb/E4w
Mf1X7hA!SiP5GG2FRW0Tn3KrwquVArRWELcOAvrKDqPUiPFgypGYUTVQZzZNzUE3nXTGTeA+EPoN
AQGCWu/g!Q5440tIrto4pgVF1+RBT
| X-Complaints-To: (e-mail address removed)
| X-DMCA-Complaints-To: (e-mail address removed)
| X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
| X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your
complaint properly
| X-Postfilter: 1.1
| Path:
cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.su
l.t-online.de!t-online.de!newsfeed.esat.net!logbridge.uoregon.edu!arclight.u
oregon.edu!wn11feed!worldnet.att.net!216.166.71.14!border3.nntp.aus1.giganew
s.com!intern1.nntp.aus1.giganews.com!nntp.giganews.com!nntp.speakeasy.net!ne
ws.speakeasy.net.POSTED!not-for-mail
| Xref: cpmsftngxa07.phx.gbl
microsoft.public.dotnet.framework.compactframework:41291
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| I have a custom control that uses a ListView control in it. It worked as
| expected until SP2. Now with SP2, the left-most visible (width > 0)
column's
| width is displaying much too wide, for no apparent reason.
|
| Scenario:
| ListView Column 1 width set to 0 (I hide the first col)
| Column 2 width set to -2 (auto-size col width to header text width),
column
| header text set to "Name"
| Column 3 width set to -2, column header text set to "Gender Id"
|
| With SP1, the first col was hidden, the second and third column widths
were
| sized to the width of the column headers, as the -2 value is supposed to
do.
|
| With SP2, the first col was hidden, the second column was about 3 times
the
| width of its column header value (which is "Name") and third column width
| was normal (sized correctly to the header value width).
|
| I took the same code and ran it on a device that still had only SP1 on it.
| The results were back to normal, the columns with -2 as their width
| property, were sized correctly to the width of the headers.
|
| Conclusion:
| It seems to only affect the left-most visible column. If the left-most
| column is set to width = 0, then the next column to the right, set to -2
| width, will display too wide (way too wide). The columns following that,
set
| to -2 width, will display correctly.
|
| If the first column's width property is set to -2, then that column
displays
| too wide, and subsequent columns set to -2 display predictably.
|
| Does anyone else see this behavior? Can Microsoft look into this?
|
| Thanks,
| Tim
|
|
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top