Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

VGridControlBase.FocusedRowChanged Event

Fires in response to row focus moving.

Namespace: DevExpress.XtraVerticalGrid

Assembly: DevExpress.XtraVerticalGrid.v24.2.dll

NuGet Packages: DevExpress.Win.Navigation, DevExpress.Win.VerticalGrid

#Declaration

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
OldRow Gets the previously focused row.
Row Gets the processed row. Inherited from RowEventArgs.

#Remarks

The FocusedRowChanged event is raised when an end-user moves focus from one row to another or in response to changing the VGridControlBase.FocusedRow property in code.

This event parameter’s FocusedRowChangedEventArgs.OldRow and RowEventArgs.Row properties allow the previously and currently focused row to be determined, respectively.

For more information, see Focus and Scroll Rows.

#Example

The following sample code handles the VGridControlBase.FocusedRowChanged event to show an image within the focused row header.

using DevExpress.XtraVerticalGrid.Events;

private void vGridControl1_FocusedRowChanged(object sender, FocusedRowChangedEventArgs e) {
   if (e.OldRow == null){
      e.Row.Properties.ImageIndex = 0;
   }
   else {
      e.Row.Properties.ImageIndex = 0;
      e.OldRow.Properties.ImageIndex = -1;
   }
}
See Also