InsertCategory Method
Description
The InsertCategory method is used to insert a new category into the Property Grid at a specific position.
Syntax
Public Function InsertCategory( _
ByVal [Index](#) As Integer, _
ByVal [Title](#) As String _
) As [PropertyGridItem](XtremePropertyGrid~PropertyGridItem.md)
Parameters
- Index: The position in the collection of categories to insert the new category.
- Title: The caption/title of the category.
Return Type
Pointer to the category at the specified index that was inserted into the grid.
Remarks
The InsertCategory method creates a new category and inserts it at the specified index.
Categories are used to group PropertyGridItems into groups within the PropertyGrid. By default, the background color of categories is displayed in a different color than normal items. Categories have an expand/collapse button that can be used to show/hide the PropertyGridItems that belong to the category.
Example
InsertCategory Sample (Visual Basic)
This sample illustrates how to use the InsertCategory method to create a new category and insert it at a specific position in the grid.
' Create a new category called "New Category" and place it as
' the first category in the property grid.
wndPropertyGrid.InsertCategory 0, "New Category"
See Also
Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.