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

[Solved] RadGridView and RowStyleSelections

2 Answers 96 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.
Ricky
Top achievements
Rank 1
Ricky asked on 23 Jun 2011, 06:10 PM
I am developing an application that uses RadGridViews throughout with telerik:StyleManager.Theme="Windows7" applied to them. I am now developing a grid that uses RowStyleSelections to customize rows font color depending on special conditions
(I used http://www.telerik.com/help/wpf/gridview-rowstyleselector.html to make this change).

      <Style TargetType="telerik:GridViewRow">
                    <Setter Property="Foreground" Value="Red"/>
                    <Setter Property="FontWeight" Value="Bold"/>
                </Style>
            </special:EventLogStyleSelector.HighPriority>
            <special:EventLogStyleSelector.NotHighPriority>
                <Style TargetType="telerik:GridViewRow">
                    <Setter Property="Foreground" Value="Black"/>
                </Style>


Unfortunately, some of the rows styles changed in an undesired way. Now when rows are selected, they have the default style of being light orange instead of the light blue from the Windows7 style.

Is there anyway to combine this custom style with the Windows7 style or mimic it?

2 Answers, 1 is accepted

Sort by
0
Accepted
Vanya Pavlova
Telerik team
answered on 24 Jun 2011, 08:50 AM
Hello Ricky,

 

The styles used in our themes are theme specific. You have defined an implict styles based on the default Office_Black theme. If you want to apply these styles based on any theme different than the default one you should change the styles as shown below:


<Style TargetType="telerik:GridViewRow" telerik:StyleManager.BasedOn="Windows7">
                   <Setter Property="Foreground" Value="Red"/>
                   <Setter Property="FontWeight" Value="Bold"/>
               </Style>
           </special:EventLogStyleSelector.HighPriority>
           <special:EventLogStyleSelector.NotHighPriority>
               <Style TargetType="telerik:GridViewRow" telerik:StyleManager.BasedOn="Windows7">
                   <Setter Property="Foreground" Value="Black"/>
  </Style>


Then the style will be applied relatively to Windows7 theme. You may do the same for any other Telerik theme.

All the best,
Vanya Pavlova
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Ricky
Top achievements
Rank 1
answered on 27 Jun 2011, 03:01 PM
Hello Vanya,

Thank you for the help. I've marked your response as the correct answer.

Thanks again,

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