Skip to main content
All docs
V25.2
  • 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

    [Browsable(false)]
    public virtual GridBand FocusedBand { get; set; }

    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

    • FocusedBand is 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 FocusedBand member for these Views.

      The FocusedBand member can only be used with Views that display real data within the Grid Control. Use the following API to access these Views:

    See Also