windowsforms-devexpress-dot-xtraverticalgrid-dot-vgridcontrolbase-8914e625.md
Fires in response to row focus moving.
Namespace : DevExpress.XtraVerticalGrid
Assembly : DevExpress.XtraVerticalGrid.v25.2.dll
NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.VerticalGrid
public event FocusedRowChangedEventHandler FocusedRowChanged
Public Event FocusedRowChanged As FocusedRowChangedEventHandler
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. |
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.
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;
}
}
Imports DevExpress.XtraVerticalGrid.Events
Private Sub VGridControl1_FocusedRowChanged(ByVal sender As Object, _
ByVal e As FocusedRowChangedEventArgs) Handles VGridControl1.FocusedRowChanged
If e.OldRow Is Nothing Then
e.Row.Properties.ImageIndex = 0
Else
e.Row.Properties.ImageIndex = 0
e.OldRow.Properties.ImageIndex = -1
End If
End Sub
See Also