ColumnView.FocusedRowChanged Event
Fires in response to changing the position of the focused row.
Namespace: DevExpress.XtraGrid.Views.Base
Assembly: DevExpress.XtraGrid.v18.1.dll
Declaration
[DXCategory("Property Changed")]
public event FocusedRowChangedEventHandler FocusedRowChanged
Event Data
The FocusedRowChanged event's data class is FocusedRowChangedEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
FocusedRowHandle | Gets the handle of the currently focused row. |
PrevFocusedRowHandle | Gets the handle of the previously focused row. |
Remarks
The FocusedRowChanged event is raised when the ColumnView.FocusedRowHandle property is changed. This happens when the position of the focused row changes.
Note
When moving focus between Views, the FocusedRowChanged event is not raised. The grid control’s GridControl.FocusedViewChanged event is raised instead.
See ColumnView.FocusedRowObjectChanged to learn more.
Example
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);
}
}
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the FocusedRowChanged event.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.