Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Property Grid
  New Posts New Posts RSS Feed - Bug in FindItem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Bug in FindItem

 Post Reply Post Reply
Author
Message
Superpippo View Drop Down
Groupie
Groupie


Joined: 02 March 2005
Status: Offline
Points: 67
Post Options Post Options   Thanks (0) Thanks(0)   Quote Superpippo Quote  Post ReplyReply Direct Link To This Post Topic: Bug in FindItem
    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
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
Superpippo View Drop Down
Groupie
Groupie


Joined: 02 March 2005
Status: Offline
Points: 67
Post Options Post Options   Thanks (0) Thanks(0)   Quote Superpippo Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Superpippo View Drop Down
Groupie
Groupie


Joined: 02 March 2005
Status: Offline
Points: 67
Post Options Post Options   Thanks (0) Thanks(0)   Quote Superpippo Quote  Post ReplyReply Direct Link To This Post Posted: 26 October 2005 at 2:51am

Post Scriptum:

also finditem by tag doesn't work.

Bye

 

SuperPippo
Back to Top
ianp View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 19 December 2003
Location: United Kingdom
Status: Offline
Points: 119
Post Options Post Options   Thanks (0) Thanks(0)   Quote ianp Quote  Post ReplyReply Direct Link To This Post 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?



Edited by ianp
Back to Top
Superpippo View Drop Down
Groupie
Groupie


Joined: 02 March 2005
Status: Offline
Points: 67
Post Options Post Options   Thanks (0) Thanks(0)   Quote Superpippo Quote  Post ReplyReply Direct Link To This Post Posted: 26 October 2005 at 10:58am

Ok you are rigth!

Just id=0 is a mistake.

Thanks a lot.

 

SuperPippo
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.