This example handles the CustomDrawColumnHeader event to apply a hot-track state for the focused column.
The example also handles FocusedColumnChanged and Layout events to call the InvalidateColumnHeader mehthod to forcibly repaint column headers when the focused column or the GridView's layout is changed.
private void gridView1_CustomDrawColumnHeader(object sender, ColumnHeaderCustomDrawEventArgs e) {
GridView view = sender as GridView;
if (e.Column?.FieldName == view.FocusedColumn.FieldName)
e.Info.State = ObjectState.Hot;
}
private void gridView1_FocusedColumnChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedColumnChangedEventArgs e) {
((GridView)sender).InvalidateColumnHeader(e.FocusedColumn);
((GridView)sender).InvalidateColumnHeader(e.PrevFocusedColumn);
}
private void gridView1_Layout(object sender, EventArgs e) {
((GridView)sender).InvalidateColumnHeader(null);
}
(you will be redirected to DevExpress.com to submit your response)