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

[Solved] Row and Header Styles in GridView

1 Answer 183 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.
Silverlight Student
Top achievements
Rank 1
Silverlight Student asked on 17 Sep 2009, 11:33 AM
Hi,

I am using GridView for my SL 3 application.
How can we use styles for rows (and alternative rows) ?
How we can use styles for Headers ? We did not find any theme.dll file.


Please help me on this.

Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Missing User
answered on 17 Sep 2009, 12:43 PM
Hi Silverlight Student,

If you want to use styles you should work with the RowStyle, AlternatingRowStyle and HeaderRowStyle of the grid. Something like this:

<Grid.Resources> 
            <Style TargetType="gridView:GridViewRow" x:Key="RowStyle">  
                <Setter Property="Background" Value="Yellow"/>  
                <Setter Property="Foreground" Value="Blue"/>  
            </Style> 
            <Style TargetType="gridView:GridViewRow" x:Key="AlternateRowStyle">  
                 <Setter Property="Background" Value="Blue"/>  
                 <Setter Property="Foreground" Value="Yellow"/>  
            </Style> 
            <Style TargetType="gridView:GridViewHeaderRow" x:Key="HeaderRowStyle">  
                 <Setter Property="Background" Value="Black"/>  
            </Style> 
</Grid.Resources> 
 
  ..........  
 
            <telerik:RadGridView Name="gridView" UseAlternateRowStyle="True" RowStyle="{StaticResource RowStyle}" AlternateRowStyle="{StaticResource AlternateRowStyle}" HeaderRowStyle="{StaticResource HeaderRowStyle}"/> 

I'm attaching a sample application for your reference.

If you want to make more complicated modifications you will have to restyle RadGridView in Expression Blend.
I believe these articles -Styling RadGridView Header &  Styling RadGridView Rows -  will help you to achieve your goal.

All telerik theme dlls should be found in the default location for our Silverlight controls :
  %ProgramFiles%\Telerik\RadControls for Silverlight Q2 2009\Binaries\Silverlight .

Hope this helps.

Regards,
Anastasia
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Silverlight Student
Top achievements
Rank 1
Answers by
Missing User
Share this question
or