Row highlight disappears as background is set

4 posts, 0 answers
  1. Huy
    Huy avatar
    10 posts
    Member since:
    Jul 2014

    Posted 14 Aug 2014 Link to this post

    Is there a way for me to highlight the cell with a background when it's selected?
    By default, the row highlight is completely suppressed by setting the background (attached screenshot)

    Thanks
  2. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 15 Aug 2014 Link to this post

    Hi Huy,


    Thank you for contacting us.

    Looking at the example you referred, the behavior could be considered as expected. 
    If you take a look at the default template of GridViewRow, you may notice an element DataCellsPresenter. This element is responsible for drawing cells in each type of row. 

    Visually this element is rendered on the top of all elements, as part of GridViewRow's template. 

    CellStyleSelector example uses the default WPF AccentBrush from our QSF-UI for WPF. 
    In case you need to apply a background to a cell and to persist the default highlight of a row you should use a color, which allows transparency:

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

    May you verify how this corresponds to your needs?

    Regards,
    Vanya Pavlova
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. Huy
    Huy avatar
    10 posts
    Member since:
    Jul 2014

    Posted 15 Aug 2014 in reply to Vanya Pavlova Link to this post

    Hi Vanya,

    I didn't know that we can set a transparent color to the background

    Thanks alot :)
  4. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 18 Aug 2014 Link to this post

    Hello Huy,


    Thank you for getting back to us. I'm glad to hear that I was able to help. 

    If you encounter any problems do not hesitate to contact us. 
    Have a great day. 


    Regards,
    Vanya Pavlova
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
Back to Top