Print Page | Close Window

Categories

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=806
Printed Date: 23 November 2024 at 5:00am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Categories
Posted By: vbuser
Subject: Categories
Date Posted: 03 June 2004 at 1:59am

How can I add items and ADD or USE categories previously added into the control? My application adds Field names from a table, these field names must be loaded to the correct category section of the property grid, the first 3 fields may need to go to CATEGORY A, the next, CATEGORY B, and the next field may need to go to CATEGORY A - If I add the category on every item, (set Category = wndPropertyGrid.AddCategory("Category") I get DUPLICATE categories... How can I accomplish this? Keep in mind that I don't really know how many categories will be loaded into the control until every item is added and analyzed. May be using wndPropertyGrid.FindItem.....????? Thank you! 




Replies:
Posted By: SuperMario
Date Posted: 03 June 2004 at 6:43am
Yes, you will need to use the FindItem method to reference the category you want to add items to.


Posted By: vbuser
Date Posted: 04 June 2004 at 12:54am
Can you please provide an example in how to look for the category, then assign the object so that more items can be added to the matching category... I've tried in many ways and looked at the available help - As usual the HELP on ALL of these components is BAD - Gives only internal references and NO REAL world examples in how to implement it. Thank you!


Posted By: SuperMario
Date Posted: 04 June 2004 at 6:42am
Ok, say you add 2 categories, "Application" and "Project," now you want to find the "Application" category so you can add more items.  Try something like this:

    Dim Category As PropertyGridItem
    
    Set Category = wndPropertyGrid.AddCategory("Application")
    Category.AddChildItemBinded PropertyItemString, Me, "Namespace"
    Category.AddChildItemBinded PropertyItemString, Me, "Startup Object"
   
    Set Category = wndPropertyGrid.AddCategory("Project")
    Category.AddChildItemBinded PropertyItemString, Me, "Application Icon"
   
    Set Category = wndPropertyGrid.FindItem("Application")
    If Not Category Is Nothing Then
        Category.AddChildItemBinded PropertyItemString, Me, "Project File"
        Category.AddChildItemBinded PropertyItemString, Me, "Project Folder"
    End If





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