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

Row highlight disappears as background is set

3 Answers 72 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Huy
Top achievements
Rank 1
Huy asked on 14 Aug 2014, 03:34 PM
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

3 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 15 Aug 2014, 07:38 AM
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.
 
0
Huy
Top achievements
Rank 1
answered on 15 Aug 2014, 06:31 PM
Hi Vanya,

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

Thanks alot :)
0
Vanya Pavlova
Telerik team
answered on 18 Aug 2014, 07:23 AM
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.
 
Tags
GridView
Asked by
Huy
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Huy
Top achievements
Rank 1
Share this question
or