FileExplorerAssistant.Attach(GridControl, Action<GridControlExtension>) Method
In This Article
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 | Grid |
The Data Grid that should be managed by the newly created |
#Optional Parameters
Name | Type | Default | Description |
---|---|---|---|
settings | Action<DevExpress. |
null | A delegate that sets up the newly created |
#Returns
Type | Description |
---|---|
DevExpress. |
The newly created |
#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