tricks801
asked on
C1 Flex Grid - Focus Style and HIghlight Style
i have a component one flex grid with three columns.
I want to set the whole row to be blue with white text when the user selects that row and gray with black text when the grid loses focus.
I want to set the whole row to be blue with white text when the user selects that row and gray with black text when the grid loses focus.
ASKER
Im familiar with the Styles properties. The problem with these are that they are of type CellStyleCollection, so they only affect one cell at a time.
Ex. .Styles.Focus.BackColor = SystemColors.Highlight will only set the color of the selected cell.
I decided to use the TrueDB grid. thanks
Ex. .Styles.Focus.BackColor = SystemColors.Highlight will only set the color of the selected cell.
I decided to use the TrueDB grid. thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The key is figuring out which style to set... you said, "when the grid loses focus", did you mean when the row is no longer highlighted? Or when the whole grid loses focus? I don't believe that the grid has a built-in style for this, so, you'd probably have to alter the Normal style when the control gets a Lost Focus and a Got Focus event.
Also, I don't believe the grid has a built-in style for "selected" rows. Typically, rows selected by the user clicking them become highlighted, and so it is the Highlighted style you want to set... however, I seem to remember cases where things might be selected in code, but do not appear highlighted on the screen.
Once you know which styles you want to set, let me know and I can show you code for setting them at runtime if you need to... and/or, if you want to create a new style and apply that to any part of the grid, I can show you how to do that too.