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

Transparent Background GridViewRow Style makes all rows disappear

3 Answers 294 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Dean
Top achievements
Rank 1
Dean asked on 21 Sep 2012, 07:34 PM
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?

3 Answers, 1 is accepted

Sort by
0
Dean
Top achievements
Rank 1
answered on 21 Sep 2012, 08:57 PM
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...
0
Dean
Top achievements
Rank 1
answered on 22 Sep 2012, 01:29 AM
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.
0
Vlad
Telerik team
answered on 24 Sep 2012, 06:07 AM
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.

Tags
GridView
Asked by
Dean
Top achievements
Rank 1
Answers by
Dean
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or