Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1612
UltraGrid - prevent ActiveRowAppearance background to change cell background
posted

Is there an option to set ActiveRowAppearance.BackColor that way it will not overwrite cells bacground ?


Im my project Im showing discrepancies in cells by cell's BackColor = Red

If I have ActiveRowAppearance.BackColor = Blue I cant see any cells markings

I tried to use BackColor alpha level etc but with no much luck

Unfortunately I need clear ActiveRow clear marking - border / font color change is not enough - BackColor is most welcome by users

  • 25665
    Offline posted

    Hello Maciej,

    Thank you for contacting Infragistics!

    You will want to set the ActiveAppearance on the cell, in addition to the Appearance:

    private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
    {
    var layout = e.Layout;
    var band = layout.Bands[0];
    var ov = layout.Override;

    ov.ActiveRowAppearance.BackColor = Color.Red;
    }

    private void ultraGrid1_InitializeRow(object sender, InitializeRowEventArgs e)
    {
    var row = e.Row;

    row.Cells[1].Appearance.BackColor = Color.Yellow;
    row.Cells[1].Appearance.ForeColor = Color.Black;

    // If you don't do this, the ActiveRowAppearance will override the yellow for
    // the cell in the active row.
    row.Cells[1].ActiveAppearance.BackColor = Color.Yellow;
    row.Cells[1].ActiveAppearance.ForeColor = Color.Black;
    }