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

[Solved] No joy with AlternateRowBackground?

3 Answers 129 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Temp
Top achievements
Rank 1
Temp asked on 20 Apr 2010, 06:18 AM
Is there any reason I would be having no luck with getting my alternate rows to change background color with the following code? They just all stay white.



<telerikGridView:RadGridView   
                    x:Name="RadGrid8020"   
                    MinWidth="400" MaxWidth="900" 
                    ShowGroupPanel="false"   
                    CanUserDeleteRows="false"     
                    CanUserFreezeColumns="false" 
                    CanUserInsertRows="false" 
                    CanUserReorderColumns="true" 
                    CanUserResizeColumns="false" 
                    CanUserSelect="true" 
                    CanUserSortColumns="true" 
                    IsReadOnly="true"   
                    AutoGenerateColumns="false" ScrollMode="RealTime" RowLoaded="RadGrid8020_RowLoaded" AlternateRowBackground="#FFB3B38D" 
                >     
                <telerikGridView:RadGridView.SortDescriptors> 
                    <telerikData:SortDescriptor Member="Rank" SortDirection="Ascending" /> 
                </telerikGridView:RadGridView.SortDescriptors> 
                <telerikGridView:RadGridView.GroupHeaderTemplate> 
                    <DataTemplate> 
                        <TextBlock Foreground="Green" Text="" Loaded="RadGrid8020_TextBlock_Loaded"/>  
                    </DataTemplate> 
                </telerikGridView:RadGridView.GroupHeaderTemplate> 
                <telerikGridView:RadGridView.Columns> 
                    <telerikGridView:GridViewDataColumn DataMemberBinding="{Binding Rank}" Header="Rank" IsFilterable="false" IsSortable="true">  
                        <telerikGridView:GridViewDataColumn.CellTemplate> 
                            <DataTemplate> 
                                <StackPanel Orientation="Horizontal">  
                                    <Image Loaded="RadGrid8020_RankMoveImage_Loaded" Margin="0,0,5,0">  
                                    </Image><TextBlock Text="{Binding Rank}"/>  
                                </StackPanel> 
                            </DataTemplate> 
                        </telerikGridView:GridViewDataColumn.CellTemplate> 
                    </telerikGridView:GridViewDataColumn> 
                    <telerikGridView:GridViewDataColumn DataMemberBinding="{Binding CustomerName}" Header="Client" HeaderTextAlignment="Left" IsFilterable="false" IsSortable="true" TextAlignment="Left" /> 
                    <telerikGridView:GridViewDataColumn DataMemberBinding="{Binding JobCount}" Header="Job Count" HeaderTextAlignment="Right" IsFilterable="false" IsSortable="true" TextAlignment="Right" DataFormatString="{}{0:n0}" /> 
                    <telerikGridView:GridViewDataColumn DataMemberBinding="{Binding Turnover}" Header="Turnover" HeaderTextAlignment="Right" IsFilterable="false" IsSortable="true" TextAlignment="Right" DataFormatString="{}{0:c2}"/>  
                    <telerikGridView:GridViewDataColumn DataMemberBinding="{Binding AverageJobTurnover}" Header="Avg Per Job" HeaderTextAlignment="Right" IsFilterable="false" TextAlignment="Right" DataFormatString="{}{0:c2}" /> 
                </telerikGridView:RadGridView.Columns> 
            </telerikGridView:RadGridView> 

3 Answers, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 20 Apr 2010, 07:22 AM
Hi,

You may need to set AlternationCount - for example to 2.

Kind regards,
Vlad
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
daniel
Top achievements
Rank 1
answered on 14 Sep 2010, 10:34 PM
Unfortunately this isn't working for me either.  My tag looks basically like:

<telerikSchema:RadGridView Name="SearchResults"
ItemsSource="{Binding xxx}" 
telerikSchema:RadControl.Theme="Windows7"
ShowGroupPanel="False"
AutoGenerateColumns="False" 
CanUserFreezeColumns="False" 
CanUserInsertRows="False" 
CanUserReorderColumns="False" 
RowIndicatorVisibility="Collapsed" 
HorizontalAlignment="Stretch" 
VerticalAlignment="Stretch" 
Background="LightGray" 
BorderBrush="{x:Null}" 
AlternateRowBackground="White" 
SelectionMode="Extended"
CanUserDeleteRows="False" 
GridLinesVisibility="Horizontal"
AlternationCount="1"
IsEnabled="{Binding xxx}"
>
0
Vlad
Telerik team
answered on 15 Sep 2010, 06:56 AM
Hi,

 You need to set AlternationCount to 2.

Kind regards,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Temp
Top achievements
Rank 1
Answers by
Vlad
Telerik team
daniel
Top achievements
Rank 1
Share this question
or