In RowLoaded event, i set foreground color of cell, but when i run my application, the cell foreground is not applied.
When i scroll the vertical scroll --> the foreground color is changed.
--> thank to tell me how to fix this bug.
6 Answers, 1 is accepted
Since the virtualization of RadGridView is turned on by default, it is not recommended to work with the visual elements and their properties. I would recommend you to work with the data elements instead. You can take a look at this article for a reference on how to use CellTemplateSelector.
Please let me know if you can apply this approach to your scenario.
Didie
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
Thank for your answer quickly.
i read your reference article before. The apply CellTemplateSelector is ok.
I must change cell foreground color in RowLoaded event because i need check the value of other cell in same row to detect color.
please help me!
You say that you must change cell foreground color based on the value of other cell in same row. Why don't you work with the bound data item (for the row)? You could access all the values from the bound item ("club" in the help article) and based on them decide what foreground color to return.
Didie
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
How do you decide what foreground color to return when the RowLoaded event is raised? Is it possible to apply similar logic with the TemplateSelector?
Didie
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
Note:
- the specific column maybe not existed --> in this case, do not change foreground color of other cells
- the number column of grid and column header is dynamic and different for each screen