Cell backgroud color (Transparent)

2 posts, 0 answers
  1. Bo
    Bo avatar
    5 posts
    Member since:
    Jul 2011

    Posted 22 May 2012 Link to this post

    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
  2. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 22 May 2012 Link to this post

    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 >>

Back to Top