I am using the RowFormatting for alternating row color. I am also planning to use it to insert a progress bar in a column. It seems to me that the event does not fire until I click on the grid. I would like this formatting to occur when the form loads. Am I missing something?
3 Answers, 1 is accepted
0
Accepted
Martin Vasilev
Telerik team
answered on 16 Apr 2008, 08:37 AM
Hi Ron Coffee,
Thank you for the question.
RowFormating and CellFormating events fire eveyrtime a row or cell have been created. Keep in mind that this is the case only for visible ones. To handle the event, you should subscribe to it before creating the RadGridView's elements. In most cases that is before binding to DataSource.
To add a progress bar in a column, it will be better if you use the CelFormating instead the RowFormating, because you have to modify cell by cell for one column, not an entire row.
I hope this was helps. If you have additional questions, do not hesitate to contact me again.
Thanks. Now I have anothe related problem. After I format the alternating rows, and the user scrolls down, all the rows trun the same color. Any thoughts how to maintain the alternating colors?
0
Martin Vasilev
Telerik team
answered on 24 Apr 2008, 03:01 PM
Hello Ron Coffee,
Thank you for contacting us again.
When you use the RowFormating event for creating alternating rows you have to always set the colors for both the odd and even rows:
Moreover, I want to bring your attention to our new version of RadGridView Q1 2008 version. It supports built in settings for alternating rows. Please review the code-block below: