Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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

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

#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