Table of Contents

Class PropertyGridControl

Namespace
Alternet.FormDesigner.WinForms
Assembly
Alternet.FormDesigner.v9.dll

Provides a user interface for browsing the properties of an object.

[ToolboxBitmap(typeof(PropertyGridControl), "Images.PropertyGridControl.Icon.bmp")]
public class PropertyGridControl : Control, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, IPropertyGridControl
Inheritance
PropertyGridControl
Implements

Examples

Here is how to declare a PropertyGridControl and handle its events from the C# code:

public partial class Form1 : Form
{
    private void Form1_Load(object sender, EventArgs e)
    {
        var propertyGrid = new Alternet.FormDesigner.WinForms.PropertyGridControl();
        propertyGrid.Dock = System.Windows.Forms.DockStyle.Fill;
        propertyGrid.FormDesignerControl = designer;
        propertyGrid.PreFilterProperties += PropertyGridControl_PreFilterProperties;
    }

    private void PropertyGridControl_PreFilterProperties(object sender, Alternet.FormDesigner.WinForms.PropertyGrid.PreFilterPropertiesEventArgs e)
    {
        if (e.Property.Name.StartsWith("Auto"))
        {
            e.IsExcluded = true;
        }
    }
}

Here is how to declare a PropertyGridControl and handle its events from the Visual Basic code:

Partial Public Class Form1
    Inherits Form

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
        Dim propertyGrid = New Alternet.FormDesigner.WinForms.PropertyGridControl()
        propertyGrid.Dock = System.Windows.Forms.DockStyle.Fill
        propertyGrid.FormDesignerControl = designer
        AddHandler propertyGrid.PreFilterProperties, AddressOf PropertyGridControl_PreFilterProperties
    End Sub

    Private Sub PropertyGridControl_PreFilterProperties(ByVal sender As Object, ByVal e As Alternet.FormDesigner.WinForms.PropertyGrid.PreFilterPropertiesEventArgs)
        If e.Property.Name.StartsWith("Auto") Then
            e.IsExcluded = True
        End If
    End Sub
End Class

Remarks

PropertyGridControl control allows you to view and change the design-time properties and events of selected objects on the designed form by the FormDesignerControl.

The most important properties of the PropertyGrid are:

Set FormDesignerControl property to specify the Form Designer control associated with the PropertyGrid control.

Constructors

PropertyGridControl()

Initializes a new instance of the PropertyGridControl class with default settings.

Properties

ControlListVisible
FilterTextBoxVisible
FormDesignerControl

Gets or sets an IFormDesignerControl related to this property grid.

LineColor
PropertyBlacklist
PropertyGrid
SelectedObjects

When implemented by a class, gets or sets the currently selected objects.

Methods

ApplySelectedObjects()
OnHandleCreated(EventArgs)

Raises the HandleCreated event.

OnLayout(LayoutEventArgs)

Raises the Layout event.

Events

PreFilterProperties