Transparent Background GridViewRow Style makes all rows disappear

4 posts, 0 answers
  1. Dean K.
    Dean K. avatar
    55 posts
    Member since:
    Aug 2011

    Posted 21 Sep 2012 Link to this post

    Using latest .NET 4 version (2012.2.912.40) I am trying to get my 
    RadGridView rows to have transparent background but given this
    XAML (relevant parts only) all rows simply disappear:

    xmlns:t="http://schemas.telerik.com/2008/xaml/presentation"
    

    <
    Grid>
           
    <Grid.Resources>             <Style x:Key="gvrStyle" TargetType="t:GridViewRow">                 <Setter Property="Background" Value="Transparent"/>             </Style>         </Grid.Resources>
    <t:RadGridView x:Name="rgvSessions" Background="Transparent" 
                SelectionMode="Single" ItemsSource="{Binding ItemsSource}" 
    AutoGenerateColumns
    ="False"
    RowStyle
    ="{StaticResource ResourceKey=gvrStyle}"
    SelectedItem
    ="{Binding SelectedItem, Mode=OneWayToSource}">
    </t:RadGridView>
    

    </Grid>
    
    When I remove the RowStyle="{StaticResource ResourceKey=gvrStyle}
    from the RadGridView the rows reappear but the background is white.
    This happens when ever RowStyle property is used even if the only
    property I'm setting in the style is Height, for example.

    Anyway, the RadGridView itself is transparent but how do I get the rows
    to be transparent as well?
  2. Dean K.
    Dean K. avatar
    55 posts
    Member since:
    Aug 2011

    Posted 21 Sep 2012 Link to this post

    Also tried removing RowStyle="{StaticResource ResourceKey=gvrStyle}" 
    and defining the RowStyle within the RadGridView itself and all the rows disappeared again:

    <t:RadGridView x:Name="rgvSessions" Background="Transparent" 
                SelectionMode="Single" ItemsSource="{Binding ItemsSource}" 
    AutoGenerateColumns
    ="False"
    SelectedItem
    ="{Binding SelectedItem, Mode=OneWayToSource}">

                <t:RadGridView.RowStyle>
                    <Style TargetType="t:GridViewRow">
                        <Setter Property="Background" Value="AliceBlue"/>
                    </Style>
                </t:RadGridView.RowStyle>
    </t:RadGridView>
    
    Also tried moving the style to a resource file and using as DynamicResource,
    in other words, any way I use to set the row style it results in all
    rows disappearing...
  3. UI for WPF is Visual Studio 2017 Ready
  4. Dean K.
    Dean K. avatar
    55 posts
    Member since:
    Aug 2011

    Posted 21 Sep 2012 Link to this post

    After further investigation  I established that this only occurs when using NoXaml binaries.

    Switching to full binaries resolved the problem and setting the RowStyle property now works fine.

    It appears this is a bug.

    I Tried uploading the sample solution which demonstrates this but zip
    file is not allowed and "submit a support ticket" takes me to a page where it is not clear how
    to submit a support ticket (especially Friday night) so I was not able to submit a sample solution.
  5. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 24 Sep 2012 Link to this post

    Hi,

     You need to have BasedOn as shown on our documentation:
    http://www.telerik.com/help/wpf/styling-apperance-implicit-styles-overview.html 

    You will need to move also:
    <ResourceDictionary Source="Resources/Styles.xaml"/>


    at the end of your declarations in order to use already loaded types (like GridViewRowStyle).

    Kind regards,
    Vlad
    the Telerik team

    Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

Back to Top