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
475
Highlight a column in Grid
posted

How do I higlight a specific column in UltraWinGrid for forms? My requirement is, I search for a column in the grid, if the column is found then higlight it.

Thanks,

Vijayan

Parents
  • 9298
    posted

    Vijayan,

    In the InitializeLayout event you can set the BackColor of the CellAppearance property of the column like so:

    e.Layout.Bands[0].Columns["FirstAmount"].CellAppearance.BackColor = Color.Yellow;

    If you want to do it later after the grid has already been rendered on the Form, say in a Button_Click event, you could do something like this:

    foreach (UltraGridColumn col in ultraGrid1.DisplayLayout.Bands[0].Columns)
                {
                    if (col.Key == "SecondAmount")
                    {
                        col.CellAppearance.BackColor = Color.Tomato;
                    }
                }

    Try that and let me know if it works for you.

    Michael S.

     

Reply Children