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
815
Change Header On BeforeCellActivate
posted

What is the most effective way to change the appearance of the column header when a cell activates?

I have the following code placed in the BeforeCellActivate event:

For Each ocol As UltraGridColumn In ugrdSpecificAccount.DisplayLayout.Bands(0).Columns
         ocol.Header.Appearance.BackColor = Nothing ' reset backcolor on all columns
Next
e.Cell.Column.Header.Appearance.BackColor = Color.Orange ' set the current column header to orange

I want to make I am not duplicating built in functionality or performing this operation in the wrong event.  Most of my concern comes from the FOR loop and needing to reset the appearance of all columns.

 

Thanks,

Eric

 

 

Parents
  • 469350
    Verified Answer
    Offline posted

    Hi Eric,

    This is a good way to do it. If you want to make this more efficient, then there are a couple of ways you could avoid looping.

    1) You could clear the appearance in the BeforeCellDeactivate event.

    2) You could keep a member variable and store the last column that was active and then clear just that one column.

    Having an ActiveColumnHeaderAppearance and an ActiveRowSelectorAppearance are common feature requests, so these might be added in a future release, but they are not currently implemented, yet. You should Submit a feature request to Infragistics.

    The features we implement every release are based in large part on the number of requests we get. :)

     

Reply Children
No Data