PC Review


Reply
Thread Tools Rate Thread

Column Header - Strange Behavior

 
 
Aaron
Guest
Posts: n/a
 
      16th Mar 2005
In one of my listviews I have (via the designer) created two columns
at 60 pixels wide each. I've assigned Text to each column header and
set the listview as Detail, as well as make the columns nonclickable
and have checkboxes.

What I'm seeing when I open the form that the listview is on is the
right edge of the first column all the way to the very left, which
means in order to see the column contents, I have to drag the column
header separator way over to the right. Also, I have no text on my
column header (s) and I cannot see anywhere where the second column
even is...it must be out in la la land. I verified through the
debugger that both text strings that make up an item are indeed
populated with text so it's not as if the second column didn't have
any values.

One last thing, I completely deleted the listview and created a whole
new one from scratch on that same form using different column names
and widths, yet I get the exact same result! There isn't anywhere in
code I'm changing any of these settings whatsoever, I just leave them
as I've designed them. Anyone have any clues...it's really
mind-boggling!
 
Reply With Quote
 
 
 
 
Daniel Moth
Guest
Posts: n/a
 
      16th Mar 2005
Post a reproducible sample (or check it yourself: the designer generated
code is in InitializeComponent).

Cheers
Daniel
--
http://www.danielmoth.com/Blog/


"Aaron" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> In one of my listviews I have (via the designer) created two columns
> at 60 pixels wide each. I've assigned Text to each column header and
> set the listview as Detail, as well as make the columns nonclickable
> and have checkboxes.
>
> What I'm seeing when I open the form that the listview is on is the
> right edge of the first column all the way to the very left, which
> means in order to see the column contents, I have to drag the column
> header separator way over to the right. Also, I have no text on my
> column header (s) and I cannot see anywhere where the second column
> even is...it must be out in la la land. I verified through the
> debugger that both text strings that make up an item are indeed
> populated with text so it's not as if the second column didn't have
> any values.
>
> One last thing, I completely deleted the listview and created a whole
> new one from scratch on that same form using different column names
> and widths, yet I get the exact same result! There isn't anywhere in
> code I'm changing any of these settings whatsoever, I just leave them
> as I've designed them. Anyone have any clues...it's really
> mind-boggling!


 
Reply With Quote
 
Aaron
Guest
Posts: n/a
 
      16th Mar 2005
Daniel, not sure what's going on here, but here's my button click
event:

Private Sub btnArrived_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles btnArrived.Click
Dim rsDept As New InTheHand.Data.Adoce.Recordset
Dim floorID As String
Dim previousID As String
Dim floor As String
Dim item As New ListViewItem
Dim lvCount As Integer

lvCount = 0
rsDept.Open("SELECT tblServices.Number, tblServices.ServiceID,
tblFloors.FloorID, tblFloors.Floor FROM tblFloors INNER JOIN
tblServices ON tblFloors.FloorID = tblServices.FloorID WHERE
tblServices.Number = " & G_TICKET & " ORDER BY tblServices.FloorID,
tblFloors.Floor ASC", cn)
If Not rsDept.EOF And Not rsDept.BOF Then
frmDeptFloorRoom.Instance().lstDeptFloorRoom.Clear()
rsDept.MoveFirst()
While Not rsDept.EOF
floorID = rsDept.Fields(2).Value().ToString()
floor = rsDept.Fields("Floor").Value()

If lvCount > 0 Then
If floorID <> previousID Then

frmDeptFloorRoom.Instance().lstDeptFloorRoom.Items.Add(New
ListViewItem(New String() {floor, floorID}))
End If
Else

frmDeptFloorRoom.Instance().lstDeptFloorRoom.Items.Add(New
ListViewItem(New String() {floor, floorID}))
End If

lvCount = lvCount + 1
previousID = floorID
rsDept.MoveNext() 'get new values from next record
End While

'Set the listview to receive focus and highlight the first
row
frmDeptFloorRoom.Instance().lstDeptFloorRoom.Focus()
If
(frmDeptFloorRoom.Instance().lstDeptFloorRoom.Items.Count > 0) Then
Dim floorItem As ListViewItem =
frmDeptFloorRoom.Instance().lstDeptFloorRoom.Items(0)
floorItem.Focused = True
floorItem.Selected = True
End If

frmDeptFloorRoom.Instance().lstDeptFloorRoom.Font = New
Font(FontFamily.GenericSansSerif, 8, FontStyle.Regular)
frmDeptFloorRoom.Instance().Text = "My App"
Me.Text = ""
frmDeptFloorRoom.Instance().Show()

End If
End Sub

Stepping through while in debug mode, floor and floorID always have
values in them. Upon further review, I'm not even sure if there is a
second column, or if no values are ever being put into it. This is
the only code that touches my listview, no alterations are being done
anywhere else. I still cannot explain how:

1) the first column is crammed all the way over to the left

2) why no values are being written to the second column

3) why column headers are missing their text

Anyone else ever have this extremely extremely strange behavior? I'm
not a Microsoft basher but unless someone can find something in my
code, I'll assume this is yet another Microsoft bug, and not a
pleasant one at that.
 
Reply With Quote
 
Daniel Moth
Guest
Posts: n/a
 
      17th Mar 2005
Can you reproduce it in something I can actually run and debug?

Cheers
Daniel
--
http://www.danielmoth.com/Blog/


"Aaron" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Daniel, not sure what's going on here, but here's my button click
> event:
>
> Private Sub btnArrived_Click(ByVal sender As System.Object, ByVal
> e As System.EventArgs) Handles btnArrived.Click
> Dim rsDept As New InTheHand.Data.Adoce.Recordset
> Dim floorID As String
> Dim previousID As String
> Dim floor As String
> Dim item As New ListViewItem
> Dim lvCount As Integer
>
> lvCount = 0
> rsDept.Open("SELECT tblServices.Number, tblServices.ServiceID,
> tblFloors.FloorID, tblFloors.Floor FROM tblFloors INNER JOIN
> tblServices ON tblFloors.FloorID = tblServices.FloorID WHERE
> tblServices.Number = " & G_TICKET & " ORDER BY tblServices.FloorID,
> tblFloors.Floor ASC", cn)
> If Not rsDept.EOF And Not rsDept.BOF Then
> frmDeptFloorRoom.Instance().lstDeptFloorRoom.Clear()
> rsDept.MoveFirst()
> While Not rsDept.EOF
> floorID = rsDept.Fields(2).Value().ToString()
> floor = rsDept.Fields("Floor").Value()
>
> If lvCount > 0 Then
> If floorID <> previousID Then
>
> frmDeptFloorRoom.Instance().lstDeptFloorRoom.Items.Add(New
> ListViewItem(New String() {floor, floorID}))
> End If
> Else
>
> frmDeptFloorRoom.Instance().lstDeptFloorRoom.Items.Add(New
> ListViewItem(New String() {floor, floorID}))
> End If
>
> lvCount = lvCount + 1
> previousID = floorID
> rsDept.MoveNext() 'get new values from next record
> End While
>
> 'Set the listview to receive focus and highlight the first
> row
> frmDeptFloorRoom.Instance().lstDeptFloorRoom.Focus()
> If
> (frmDeptFloorRoom.Instance().lstDeptFloorRoom.Items.Count > 0) Then
> Dim floorItem As ListViewItem =
> frmDeptFloorRoom.Instance().lstDeptFloorRoom.Items(0)
> floorItem.Focused = True
> floorItem.Selected = True
> End If
>
> frmDeptFloorRoom.Instance().lstDeptFloorRoom.Font = New
> Font(FontFamily.GenericSansSerif, 8, FontStyle.Regular)
> frmDeptFloorRoom.Instance().Text = "My App"
> Me.Text = ""
> frmDeptFloorRoom.Instance().Show()
>
> End If
> End Sub
>
> Stepping through while in debug mode, floor and floorID always have
> values in them. Upon further review, I'm not even sure if there is a
> second column, or if no values are ever being put into it. This is
> the only code that touches my listview, no alterations are being done
> anywhere else. I still cannot explain how:
>
> 1) the first column is crammed all the way over to the left
>
> 2) why no values are being written to the second column
>
> 3) why column headers are missing their text
>
> Anyone else ever have this extremely extremely strange behavior? I'm
> not a Microsoft basher but unless someone can find something in my
> code, I'll assume this is yet another Microsoft bug, and not a
> pleasant one at that.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tabular Report that looks up row header and column header for query parameters Green Biro Microsoft Access Reports 1 9th Feb 2011 08:09 AM
Strange Header Behavior iamnu Microsoft Access Reports 3 6th Aug 2009 09:11 PM
Need Help: Strange, Strange Behavior ( Not Me. My Model! ) SteveM Microsoft Excel Programming 2 16th Dec 2007 07:02 PM
Search for a column based on the column header and then past data from it to another column in another workbook minkokiss Microsoft Excel Programming 2 5th Apr 2007 02:12 AM
Header behavior =?Utf-8?B?RGFuaWVs?= Microsoft Word Document Management 1 18th Oct 2006 03:46 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:18 PM.