windowsforms-devexpress-dot-xtraverticalgrid-dot-propertygridcontrol-9f103c92.md
Fires before the control is loaded. Allows you to create tabs with properties and categories in the Office View.
Namespace : DevExpress.XtraVerticalGrid
Assembly : DevExpress.XtraVerticalGrid.v25.2.dll
NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.VerticalGrid
public event TabPanelCustomizeEventHandler TabPanelCustomize
Public Event TabPanelCustomize As TabPanelCustomizeEventHandler
The TabPanelCustomize event's data class is TabPanelCustomizeEventArgs. The following properties provide information specific to this event:
| Property | Description |
|---|---|
| Buttons | Gets the collection of tabs (buttons) displayed in the panel. This property is obsolete. Use the Tabs property instead. |
| Panel | Gets the panel that contains tabs. |
| Rows | Gets the collection of rows in the property grid. |
| Tabs | Gets the collection of tabs (buttons) displayed in the panel. |
Handle the PropertyGridControl.TabPanelCustomize event as follows to create tabs in code and populate them with properties and categories:
The code sample below organizes properties into the following tabs:
using DevExpress.XtraVerticalGrid;
using DevExpress.Utils.Svg;
private void propertyGridControl1_TabPanelCustomize(object sender, DevExpress.XtraVerticalGrid.Events.TabPanelCustomizeEventArgs e) {
//Tab #1.
Tab tab1 = new Tab();
tab1.Caption = "Accessibility";
tab1.ImageOptions.Image = SvgBitmap.FromFile(@"D:\Images\Pages.svg").Render(null, 1);
//Add a property.
tab1.FieldNames.Add("Text");
//Add a category.
tab1.CategoryNames.Add("Accessibility");
//Tab #2.
Tab tab2 = new Tab();
tab2.Caption = "Appearance";
tab2.ImageOptions.Image = SvgBitmap.FromFile(@"D:\Images\Medium.svg").Render(null, 1);
tab2.CategoryNames.Add("Appearance");
e.Tabs.Add(tab1);
e.Tabs.Add(tab2);
propertyGridControl1.SelectedTab = propertyGridControl1.Tabs[0];
}
Imports DevExpress.XtraVerticalGrid
Imports DevExpress.Utils.Svg
Private Sub propertyGridControl1_TabPanelCustomize(ByVal sender As Object, ByVal e As DevExpress.XtraVerticalGrid.Events.TabPanelCustomizeEventArgs)
'Tab #1.
Dim tab1 As New Tab()
tab1.Caption = "Accessibility"
tab1.ImageOptions.Image = SvgBitmap.FromFile("D:\Images\Pages.svg").Render(Nothing, 1)
'Add a property.
tab1.FieldNames.Add("Text")
'Add a category.
tab1.CategoryNames.Add("Accessibility")
'Tab #2.
Dim tab2 As New Tab()
tab2.Caption = "Appearance"
tab2.ImageOptions.Image = SvgBitmap.FromFile("D:\Images\Medium.svg").Render(Nothing, 1)
tab2.CategoryNames.Add("Appearance")
e.Tabs.Add(tab1)
e.Tabs.Add(tab2)
propertyGridControl1.SelectedTab = propertyGridControl1.Tabs(0)
End Sub
See Also