Skip to main content
All docs
V24.2

FileExplorerAssistant.Attach(GridControl, Action<GridControlExtension>) Method

Creates a new GridControlExtension and attaches it to the target Data Grid.

Namespace: DevExpress.XtraDialogs

Assembly: DevExpress.XtraDialogs.v24.2.dll

Declaration

public GridControlExtension Attach(
    GridControl grid,
    Action<GridControlExtension> settings = null
)

Parameters

Name Type Description
grid GridControl

The Data Grid that should be managed by the newly created GridControlExtension.

Optional Parameters

Name Type Default Description
settings Action<DevExpress.XtraDialogs.FileExplorerExtensions.GridControlExtension> null

A delegate that sets up the newly created GridControlExtension.

Returns

Type Description
DevExpress.XtraDialogs.FileExplorerExtensions.GridControlExtension

The newly created GridControlExtension.

Remarks

The code below illustrates how to create a GridControlExtension with required settings and attach it to the “gridControl1” control.

using DevExpress.XtraDialogs;
using DevExpress.XtraDialogs.FileExplorerExtensions;

var gridEx = fileExplorerAssistant1.Attach(gridControl1, x => {
    x.CurrentPath = @"C:\Windows";
    x.CurrentItemChanged += OnCurrentGridItemChanged;
    // Other settings
});

void OnCurrentGridItemChanged(object sender, CurrentItemChangedEventArgs e) {
    // Synchronize TreeList and DataGrid selections
    treeEx.SetCurrentItem(e.CurrentItem);
}

See this article for more information on extensions and their core settings: Custom Browsers (FileExplorerAssistant Component).

See Also