This is a migrated thread and some comments may be shown as answers.

Formatting Cell + selected Row

1 Answer 72 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Tony
Top achievements
Rank 1
Tony asked on 10 Aug 2015, 09:28 AM

Hi everyone,

I used the CellFormatting event to Format all cell's Background and border.

So, when i click on a cell, I don't see the selected row/cell.

 

Is there any way to set an higher priority to the selected cell/row than the cell formatting ?

 

Thanks in advance.

 

Best regards,

Tony

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 10 Aug 2015, 02:45 PM
Hello Tony,

Thank you for writing.

Local settings introduced to properties in the CellFormatting event have higher priority than the theme settings for the highlighting. What I would suggest is to also style the selection color in the CellFormatting event:
private void RadGridView1_CellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e)
{
    e.CellElement.DrawFill = true;
    e.CellElement.BackColor = Color.Red;
 
    if (e.Row.IsSelected)
    {
        e.CellElement.BackColor = Color.Yellow;
    }
}

I hope this helps.

Regards,
Stefan
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
GridView
Asked by
Tony
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or