Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 78072

Cannot Resolve: GridViewAlternateRowStyle

$
0
0

I have a RadGridView and I've used the article located at: http://docs.telerik.com/devtools/wpf/controls/radgridview/style-selectors/rowstyleselector for styling the row Foreground color. Everything works great except the Alternate Rows have the same color as the "regular" (non-alternate) rows.

I use the "BasedOn" attribute of the style to use the loaded theme (expression_dark) and I thought I would create a second style just for the alternate rows. 

Here is the style code:

<Grid.Resources>
    <my:WorkListStylex:Key="WorkListStyle">
        <my:WorkListStyle.ViewItem>
            <StyleTargetType="telerik:GridViewRow"BasedOn="{StaticResource GridViewRowStyle}">
                <SetterProperty="Foreground"Value="Yellow"/>
            </Style>
        </my:WorkListStyle.ViewItem>
    </my:WorkListStyle>
    <my:WorkListAltStylex:Key="WorkListAltStyle">
        <my:WorkListAltStyle.ViewItem>
            <StyleTargetType="telerik:GridViewRow"BasedOn="{StaticResource GridViewAlternateRowStyle}">
                <SetterProperty="Foreground"Value="Yellow"/>
            </Style>
        </my:WorkListAltStyle.ViewItem>
    </my:WorkListAltStyle>
</Grid.Resources>

Then, in the RadGridView, I set these two options:

RowStyleSelector="{StaticResource WorkListStyle}"
AlternateRowStyleSelector="{StaticResource WorkListAltStyle}"

However, I get a run-time error when the xaml is parse on the "GridViewAlternateRowStyle" in the BasedOn attribute. Is there a different StaticResource I should be using? Thank you.

 


Viewing all articles
Browse latest Browse all 78072

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>