I have a wingrid that contains bands w/ about about 30 fields in each band. Each band looks quite busy.
How can I sync the appearance of the active cell and active cell's header in such a way that anytime the user clicks on a cell in a band, that particular cell's header gets a different color.
Thanks
Thanks Mike.... your solution worked. Easy enough once you know it :)
Excellent! I learned something new.
Original poster, if you use Mike's code don't forget to set UseOsThemes to false on the grid, otherwise the background color won't show up on the header.
If you have a recent version of the grid, it's actually easier than that.
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { e.Layout.Override.ActiveCellColumnHeaderAppearance.BackColor = Color.Red; }
I think the code I paste below should do the trick for what you asked once you wire the grid up to the ClickCell event.
private void ultraGrid1_ClickCell(object sender, ClickCellEventArgs e){ this.ultraGrid1.UseOsThemes = DefaultableBoolean.False; foreach (UltraGridColumn column in ultraGrid1.DisplayLayout.Bands[e.Cell.Band.Index].Columns) { column.Header.Appearance.BackColor = Color.Empty; } ultraGrid1.DisplayLayout.Bands[e.Cell.Band.Index].Columns[e.Cell.Column.Header.Caption].Header.Appearance.BackColor = Color.LightCoral;}