Print Page | Close Window

BUG: ListView: ListItems disappear

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=12574
Printed Date: 22 November 2024 at 8:55am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: BUG: ListView: ListItems disappear
Posted By: Jean
Subject: BUG: ListView: ListItems disappear
Date Posted: 30 October 2008 at 12:04pm
ListItems disappear under certain circumstances:

-Open a new project
-put a CommandButton and a ListView on the Form1
-use this code:
Private Sub Form_Load()
  Me.Width = 2175
  Me.Height = 4110

  Command1.Top = 120
  Command1.Height = 375
  Command1.Width = 1815
  Command1.Left = 120

  ListView1.Top = 600
  ListView1.Left = 120

  ListView1.HideSelection = False
  ListView1.View = xtpListViewList

  Dim lngItem As Long
  For lngItem = 1 To 16
    ListView1.ListItems.Add , CStr(lngItem), String(lngItem, Chr(lngItem + 74))
  Next
  ListView1.Arrange = xtpListViewArrangeAutoTop
End Sub

Private Sub Form_Resize()
  On Error Resume Next
  ListView1.Height = Me.ScaleHeight - 700
  ListView1.Width = Me.ScaleWidth - 240
End Sub

Private Sub Command1_Click()
  On Error Resume Next
  Dim Item As XtremeSuiteControls.ListViewItem
  For Each Item In ListView1.ListItems
    If Item.Key = "14" Then
      Item.Selected = True
      Exit For
    End If
  Next

  ListView1.SelectedItem.EnsureVisible
End Sub


-start the application and press the button
-Item with key 14 is selected and visible: Good! 
-now increase the height of the form
-ListItems disappear and there's no scrollbar

This can happen also if you resize the Form/ListView by code!
Don't I use the ListView as intended?


Another curious behavoir is that the HideSelection-Property is obviously reset if you chance the View-Property. You can check this if you change the order of the two lines in the sample code above.


-------------
Product: Xtreme SuitePro (ActiveX) Version 15.0.2
Platform: Windows XP (32bit) German - SP 2
Language: VB6 / C# 4.0



Replies:
Posted By: jpbro
Date Posted: 30 October 2008 at 1:07pm
Can't reproduce in 12.1 Beta, so maybe it is fixed?

-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: Aaron
Date Posted: 30 October 2008 at 2:27pm
Hi,
 
I can reproduce it as well. I tried with V12.0.2 and V12.1.0 Beta and both behave the same.
 
Just click command button and resize form height (list items will be arranged) and eventually will disappear including the scrollbar. As long as the selected item is NOT visible this behaviour will be produced every single time.
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: jpbro
Date Posted: 30 October 2008 at 2:46pm
You're right Aaron & Jean, I see the bug now...

-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: jpbro
Date Posted: 30 October 2008 at 2:49pm
It looks like you can put ListView1.SelectedItem.EnsureVisible in your Form_Resize event as a workaround (assuming you don't mind the selected item be key visible on resize....this may be a problem in certain situations, so obviously a fix would be the best solution).




-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: Jean
Date Posted: 03 November 2008 at 1:31am
Will there be a bug fix?


-------------
Product: Xtreme SuitePro (ActiveX) Version 15.0.2
Platform: Windows XP (32bit) German - SP 2
Language: VB6 / C# 4.0


Posted By: Oleg
Date Posted: 03 November 2008 at 1:49am

Hello,

Unfortunatelly we can't fix bugs that inside Microsoft code. ListView is based on standard ListView OS control - you can see same problem with ListView from MS controls.
Use EnsureVisible workaround.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net