How to: Expand/Collapse a Group Row When It Receives Focus
This example expands a collapsed group row and vice versa when this row receives focus.
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraGrid.Views.Base;
private void gridView1_FocusedRowChanged(object sender, FocusedRowChangedEventArgs e) {
GridView view = sender as GridView;
if (view == null) return;
if (view.IsGroupRow(e.FocusedRowHandle)) {
bool expanded = view.GetRowExpanded(e.FocusedRowHandle);
view.SetRowExpanded(e.FocusedRowHandle, !expanded);
}
}