RadGridView row color higher priority than cell color

6 posts, 0 answers
  1. Cuong
    Cuong avatar
    8 posts
    Member since:
    Jan 2015

    Posted 15 Jan 2015 Link to this post

    Hi everyone,

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

    Thanks.
  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 15 Jan 2015 Link to this post

    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.

     
  3. DevCraft banner
  4. Cuong
    Cuong avatar
    8 posts
    Member since:
    Jan 2015

    Posted 16 Jan 2015 Link to this post

    Thanks Dimitrina, it's a good way.

    But Is there any way to change cell color into row color (no transparency)?
  5. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 19 Jan 2015 Link to this post

    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.

     
  6. Cuong
    Cuong avatar
    8 posts
    Member since:
    Jan 2015

    Posted 20 Jan 2015 Link to this post

    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.
  7. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 23 Jan 2015 Link to this post

    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.

     
Back to Top
DevCraft banner