Print Page | Close Window

Bug in FindItem

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Property Grid
Forum Description: Topics Related to Codejock Property Grid
URL: http://forum.codejock.com/forum_posts.asp?TID=3091
Printed Date: 16 May 2024 at 10:57am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Bug in FindItem
Posted By: Superpippo
Subject: Bug in FindItem
Date Posted: 25 October 2005 at 5:35am

I have codejock 9.61 and i am testing PropertyGrid control in my application.

In property grid documentation you can see that finditem method can search an item by id or by caption.

I have set item.id property but when i try to get the item by finditem method with item.id i get an error.

If i try finditem with item.caption all works fine.

Can you fix this problem ?

Thanks a lot.



-------------
SuperPippo



Replies:
Posted By: SuperMario
Date Posted: 25 October 2005 at 8:06am
I think with 9.60 it started to search by Id or Caption, before that it searched by Tag or Caption. 

Can you post your syntax for adding the item and trying to find it?


Posted By: Superpippo
Date Posted: 26 October 2005 at 2:48am

I have 9.60 version and the help on line said finditem works by id or caption.

Caption works fine, id does'nt work.

To test try this code (just put it on the form load event of a vb6 form):

Private Sub Form_Load()
    Dim MyCategory As PropertyGridItem
    Dim MyItem As PropertyGridItem
    Dim MySearchItem As PropertyGridItem
   
    Set MyCategory = Me.PropertyGrid1.AddCategory("FirstCategory")
    Set MyItem = MyCategory.AddChildItem(PropertyItemNumber, "FirstItem")
    MyItem.Id = 0
   
    Set MySearchItem = Me.PropertyGrid1.FindItem(0)
   
    If MySearchItem Is Nothing Then
        msgbox "FindItem Method does'nt work!!"
    Else
        msgbox MySearchItem.Caption
    End If
End Sub

You will get the msgbox "FindItem Method does'nt work!!" .

Waiting your answer, Thanks a lot.

 

 

 

 

 



-------------
SuperPippo


Posted By: Superpippo
Date Posted: 26 October 2005 at 2:51am

Post Scriptum:

also finditem by tag doesn't work.

Bye

 



-------------
SuperPippo


Posted By: ianp
Date Posted: 26 October 2005 at 7:39am

In my brief investigations:

  • FindItem(ID) only returns an object where the ID is greater than 0, despite the Item.ID being set and stored as 0 or less - ie MyCategory.Childs.Item(1).Id returns the correct ID
  • FindItem(TAG) never seems to returns an item
  • FindItem(CAPTION) returns the first item with a matching caption

This appears correct for 9.601 and 9.80 (and I assume any version in between!?!).

Perhaps submit a bug report and post the response here?



Posted By: Superpippo
Date Posted: 26 October 2005 at 10:58am

Ok you are rigth!

Just id=0 is a mistake.

Thanks a lot.

 



-------------
SuperPippo



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