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

CellStyle for All gridView

1 Answer 151 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Valerio Giorgi
Top achievements
Rank 1
Valerio Giorgi asked on 30 Nov 2009, 02:50 PM

Hello,

How can I set the CellStyle for All Cell of RadGridView ?


1 Answer, 1 is accepted

Sort by
0
Accepted
Tsvyatko
Telerik team
answered on 01 Dec 2009, 09:22 AM
Hi Valerio Giorgi,

You can achieve this by using implicit styles defining target type and omitting key attribute. Below is sample code how to use this:

<Grid>
       <Grid.Resources>
           <Style TargetType="telerik:GridViewCell">
               <Setter Property="Background" Value="#FF525252"></Setter>
           </Style>
       </Grid.Resources>
       <Controls:RadGridView x:Name="RadGridViewExample">
           <Controls:RadGridView.Columns>
               <Controls:GridViewDataColumn DataMemberBinding="{Binding QuantityPerUnit}">
               </Controls:GridViewDataColumn>
               <Controls:GridViewDataColumn DataMemberBinding="{Binding UnitPrice}">
               </Controls:GridViewDataColumn>
           </Controls:RadGridView.Columns>
       </Controls:RadGridView>
   </Grid>

Hope this helps.

Greetings,
Tsvyatko
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
Valerio Giorgi
Top achievements
Rank 1
Answers by
Tsvyatko
Telerik team
Share this question
or