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

RadGridView row color higher priority than cell color

5 Answers 62 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Cuong
Top achievements
Rank 1
Cuong asked on 15 Jan 2015, 08:08 AM
Hi everyone,

Is there any way to set the priority of row color to be higher than cell color in RadGridView?

Thanks.

5 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 15 Jan 2015, 09:16 AM
Hello,

In case you need to apply a background to a cell and persist the default highlight of a row you should use a color, which allows transparency:
For example:

<Style TargetType="telerik:GridViewCell" BasedOn="{StaticResource GridViewCellStyle}">
    <Setter Property="Background" Value="#197709E6"/>
</Style>

How does this work for you?

Regards,
Dimitrina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Cuong
Top achievements
Rank 1
answered on 16 Jan 2015, 10:22 AM
Thanks Dimitrina, it's a good way.

But Is there any way to change cell color into row color (no transparency)?
0
Vanya Pavlova
Telerik team
answered on 19 Jan 2015, 09:03 AM
Hello Ciong,


Looking at the template structure of GridViewRow, the element DataCellsPresenter is over all elements, that paint the background of the cell in its states. DataCellsPresenter is responsible for displaying all cells.
By that reason when you color a cell, all effects from the row appear in that way. In that case you should use a color, which allows transparency. 


Regards,
Vanya Pavlova
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Cuong
Top achievements
Rank 1
answered on 21 Jan 2015, 02:50 AM
In my case, I must to color some columns of GridView.
But when I select a row or hover on it, I want to color the row (override column color).
Please help me.
0
Vanya Pavlova
Telerik team
answered on 23 Jan 2015, 03:21 PM
Hi Cuong,


I believe that this is the way to go.

If you modify the position of DataCellsPresenter, the visual elements, that paint the background of the row in any state will hide the content of the cells. 
If you want to use equal colors I may suggest you to modify the template of GridViewRow and change the Background of the element with x:Name Background_Selected
It's Background property should be the same, as the one defined for the column with transparency.


Regards,
Vanya Pavlova
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
GridView
Asked by
Cuong
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Cuong
Top achievements
Rank 1
Vanya Pavlova
Telerik team
Share this question
or