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
1705
I need to have different SelectedRowAppearances for different rows
posted

I set the background color of my rows in the RowInitialized event depending on some different conditions.  Is there any way I can change the SelectedRowAppearance for these rows without changing it for the entire grid?

  • 469350
    Offline posted

    There's no SelectedRowAppearance on an individual row. But you can probably acheive what you want using a DrawFilter.

    This post might help:

     DrawFilter for Backcolor - Infragistics Forums

  • 918
    posted

    If I understand correctly you just want to change the appearance when the row is selected?  In the initializelayout event use these lines to set the appearance of the selected rows or the active row.  The first line gives different colors to alternate row.  Might want to delete that.  Good luck.  Hope thats what you need.

    With e.Layout

    .Bands(0).Override.RowAlternateAppearance.BackColor = Color.Wheat

    .Bands(0).Override.SelectedRowAppearance.BackColor = Color.CornflowerBlue 'Color.CadetBlue

    .Bands(0).Override.SelectedCellAppearance.BackColor = Color.Cornsilk

    .Bands(0).Override.ActiveRowAppearance.BackColor = Color.CornflowerBlue

    .Bands(0).Override.ActiveCellAppearance.BackColor = Color.Aquamarine

    End with