Why does RowFormating event does not override the color for the pinned columns?
It only formats the unpinned columns of the GridView. The RowFormatting code bellow.
Can someone point me in the right direction?
Thank you very much!
6 Answers, 1 is accepted
Thank you for writing.
Depending on the specific theme, RadGridView's style may be applied the row or cell level. For the pinned rows in ControlDefault theme, it is applied at the cell level. That is why in order to achieve the desired style, it is suitable to use the CellFormatting event:
I hope this information helps. Should you have further questions I would be glad to help.
Telerik by Progress
Hello! Thanks for answering. The CellFormatting event fires for another rules that I setup. Below the code from the event. How can I squeeze the painting of the row in gray if cell value of Status column = "Finalizata"? Cant figure it out.
Thank you for writing back.
It is necessary to combine the different formatting rules in different "if" statements. However, don't forget to reset the applied settings in the default "else" clause in order to avoid applying incorrect styles to the other cells. In other words, each "if" statement that applies a certain style should have an "else" clause for resetting the options or applying some other style. Here is a sample code snippet which result is illustrated in the attached screenshot:
Note that this is just a sample approach and it may not cover all possible cases.
I hope this information helps. If you have any additional questions, please let me know.
Telerik by Progress
You can change the BackColor of the pinned rows by handling the CellFormatting event:
this.radGridView1.Rows.IsPinned = true;
private void RadGridView1_CellFormatting(object sender, CellFormattingEventArgs e)
if (e.RowIndex == 3)
e.CellElement.BackColor = Color.Red;
e.CellElement.GradientStyle = GradientStyles.Solid;
I hope this helps. Do not hesitate to contact us if you have other questions.
thank you so much Nadya...its worked perfectly