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

Cell backgroud color (Transparent)

1 Answer 78 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Bo
Top achievements
Rank 1
Bo asked on 22 May 2012, 05:13 AM
Hi There,

Can anyone teach me how to set the cell background colour to be transparent?
I have applied a template to each GridViewCell and set each component in it to be transparent but still I can see a white background colour.
I guess this white background colour comes from the row background colour but do not know how to change it.

Many thanks

Bo

1 Answer, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 22 May 2012, 05:38 AM
Hi Bo Jin,

 

The Background property of GridViewCell is set to Transparent by default. Indeed the white coloured background comes from GridViewRow and RadGridView. You may change it through defining a simple style targeted at GridViewRow and set its Background to Transparent. The Background color of RadGridView should be set to Transparent as well. Please refer to the following snippet for further reference:

<UserControl
    x:Class="SilverlightApplication74.MainPage"
    Width="640" Height="480">
<UserControl.Resources>
    <Style x:Key="style1" TargetType="telerik:GridViewRow">
        <Setter Property="Background" Value="Transparent"/>
        </Style>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot" Background="Red" DataContext="{Binding Source={StaticResource SampleDataSource}}">
        <telerik:RadGridView RowStyle="{StaticResource style1}" Background="Transparent" ItemsSource="{Binding Collection}"/>
    </Grid>
</UserControl>


Greetings,
Vanya Pavlova
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

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