BandedGridView.FocusedBand Property
Gets or sets the focused band (if the band gets focus using the keyboard or in code).
Namespace: DevExpress.XtraGrid.Views.BandedGrid
Assembly: DevExpress.XtraGrid.v25.2.dll
NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation
Declaration
Property Value
| Type | Description |
|---|---|
| GridBand | The currently focused GridBand. |
Remarks
Bands can be focused if the GridOptionsNavigation.AllowHeaderNavigation property is set to DefaultBoolean.True.
Use the FocusedBand property to access the currently focused band or to move focus to a specific band.
Note
To focus a band in code, also set the view’s FocusedRowHandle property to GridControl.BandsRowHandle.
The following code snippet moves focus to the first band on a button click:
using DevExpress.XtraEditors;
using DevExpress.XtraGrid.Views.BandedGrid;
using DevExpress.Utils;
public partial class Form1 : XtraForm {
public Form1() {
InitializeComponent();
advBandedGridView1.OptionsNavigation.AllowHeaderNavigation = DefaultBoolean.True;
focusBtn.Click += focusBtn_Click;
}
void focusBtn_Click(object sender, EventArgs e) {
advBandedGridView1.FocusedRowHandle = GridControl.BandsRowHandle;
advBandedGridView1.FocusedBand = advBandedGridView1.Bands[0];
}
}
Notes
FocusedBandis not updated if a user moves focus to a band with the mouse.Detail pattern Views do not contain data and are never displayed within XtraGrid. Do not specify the
FocusedBandmember for these Views.The
FocusedBandmember can only be used with Views that display real data within the Grid Control. Use the following API to access these Views:- GridControl.MainView - returns the top most View in a grid.
- GridControl.FocusedView - returns the focused View.
- GridControl.DefaultView - returns the currently maximized View.
- the sender parameter of View specific events;
- GridView.GetDetailView - returns a detail clone View for a specific master row.