Back to Devexpress

CustomPropertyDescriptorsEventArgs.Source Property

windowsforms-devexpress-dot-xtraverticalgrid-dot-events-dot-custompropertydescriptorseventargs-5e2d67fb.md

latest3.3 KB
Original Source

CustomPropertyDescriptorsEventArgs.Source Property

Gets the object whose properties must be retrieved via the event.

Namespace : DevExpress.XtraVerticalGrid.Events

Assembly : DevExpress.XtraVerticalGrid.v25.2.dll

NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.VerticalGrid

Declaration

csharp
public object Source { get; }
vb
Public ReadOnly Property Source As Object

Property Value

TypeDescription
Object

An object whose properties must be retrieved via the event.

|

Remarks

First, the PropertyGridControl.CustomPropertyDescriptors event fires to retrieve root properties for the selected object. The Source member will identify this selected object.

Then, when expanding a property that contains nested properties, the event fires again, to retrieve these nested properties. The Source member will identify the object representing the parent property.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Source property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-property-grid-unbound-rows/CS/DXApplication3/CustomDescriptor/UnboundRowHelper.cs#L29

csharp
{
    if ((sender as PropertyGridControl).SelectedObject == e.Source)
    {

winforms-property-grid-unbound-rows/VB/DXApplication3/CustomDescriptor/UnboundRowHelper.vb#L22

vb
Private Sub _PropertyGrid_CustomPropertyDescriptors(ByVal sender As Object, ByVal e As CustomPropertyDescriptorsEventArgs)
    If TryCast(sender, PropertyGridControl).SelectedObject Is e.Source Then
        Dim properties As PropertyDescriptorCollection = e.Properties

See Also

CustomPropertyDescriptorsEventArgs Class

CustomPropertyDescriptorsEventArgs Members

DevExpress.XtraVerticalGrid.Events Namespace