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

[Solved] Scroll bar not working

4 Answers 233 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.
Riz
Top achievements
Rank 1
Riz asked on 19 Oct 2009, 10:27 AM
Hello,

We are using template in example http://demos.telerik.com/silverlight/#GridView/CustomRowLayout, with minor changes like removed the width. The grid takes the full area available on parent control which is required. Grid present scroll bars correctly and vertical scroll bar functions properly as well.

However horizontal scroll bar doesn't function at all, please confirm if this is a bug.

We are using version 2009.2.1009.1030

Thank you very much
 

4 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 20 Oct 2009, 09:32 AM
Hello Joe,

Most probably you have some Width set in the control template of GridViewRow. Please check it and if you still think it is not working as expected send us your demo so that we can investigate it.

Best wishes,
Hristo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Riz
Top achievements
Rank 1
answered on 20 Oct 2009, 11:28 AM
 <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" x:Name="LayoutRoot" > 
        <Grid.Resources> 
 
            <LinearGradientBrush x:Key="Office_BlackPictureFrame" EndPoint="0.491356224416577,0.974451988955925" StartPoint="0.777113682471078,-0.027352265088688"
                <GradientStop Color="#FF7D7D7D" Offset="0.032501"/> 
                <GradientStop Color="#FF4D4D4D" Offset="0.036112000000000033"/> 
                <GradientStop Color="#FF656565" Offset="0.065002"/> 
                <GradientStop Color="#FF454545" Offset="0.068613000000000035"/> 
                <GradientStop Color="#FF353535" Offset="0.72841"/> 
                <GradientStop Color="#FF050505" Offset="0.987361"/> 
                <GradientStop Color="#FF9F9F9F" Offset="0.54500001668930054"/> 
                <GradientStop Color="#FF454545" Offset="0.381"/> 
                <GradientStop Color="#FF1C1C1C" Offset="0.66"/> 
            </LinearGradientBrush> 
 
            <LinearGradientBrush x:Key="Office_BlackRowBackground" EndPoint="0.5,1" StartPoint="0.5,0"
                <GradientStop Color="#FF343639" Offset="1"/> 
                <GradientStop Color="#FF373737" Offset="0"/> 
                <GradientStop Color="#FF3A3B3D" Offset="0.15"/> 
                <GradientStop Color="#FF121212" Offset="0.15"/> 
            </LinearGradientBrush> 
 
            <!--<local:ByteArrayToImageConverter x:Key="byteArrayToImageConverter" />--> 
 
            <!--<ControlTemplate x:Key="ImageCellTemplate" TargetType="telerik:GridViewCell"
                <Image Margin="0,0,0,0" Source="{Binding Picture, Converter={StaticResource byteArrayToImageConverter}}" /> 
            </ControlTemplate>--> 
 
            <ControlTemplate x:Key="MyCustomRowTemplate" TargetType="telerikGridView:GridViewRow"
                <Border x:Name="rowsContainer" Background="#FF525252" Padding="2,2,2,0"
                    <Border Background="{StaticResource Office_BlackRowBackground}" x:Name="selectedRow" 
                        BorderThickness="1" BorderBrush="#FF000000"
 
                        <Grid > 
                            <Grid.RowDefinitions> 
                                <RowDefinition Height="auto" /> 
                                <RowDefinition Height="20" /> 
                                <RowDefinition Height="20" /> 
                                <RowDefinition Height="*" /> 
                            </Grid.RowDefinitions> 
                            <Grid.ColumnDefinitions> 
                                <ColumnDefinition Width="80"/> 
                                <ColumnDefinition Width="100" /> 
                                <ColumnDefinition Width="*" /> 
                            </Grid.ColumnDefinitions> 
 
                            <TextBlock Grid.Column="1" Foreground="White" FontWeight="Bold" Grid.Row="1" Margin="0,1,1,0" 
                                       VerticalAlignment="Top" HorizontalAlignment="Left" Text="User Name:" /> 
                            <TextBlock Grid.Column="1" Foreground="White" FontWeight="Bold" Grid.Row="2" Margin="0,1,1,0" 
                                       VerticalAlignment="Top" HorizontalAlignment="Left" Text="Time:" /> 
                            <TextBlock Grid.Column="1" Foreground="White" FontWeight="Bold" Grid.Row="3" Margin="0,1,1,0" 
                                       VerticalAlignment="Top" HorizontalAlignment="Left" Text="Description:" /> 
 
                            <Border BorderThickness="1,1,1,1" CornerRadius="6,6,6,6" Grid.Row="1" Grid.RowSpan="3" Margin="15"
                                <Border.BorderBrush> 
                                    <LinearGradientBrush EndPoint="0.933220924036204,0.903735795235198" StartPoint="0.0687608619440813,0.315483972696259"
                                        <GradientStop Color="#FFDEDEDE" Offset="1"/> 
                                        <GradientStop Color="#FFFFFFFF" Offset="0.35294289873343759"/> 
                                    </LinearGradientBrush> 
                                </Border.BorderBrush> 
 
                                <Border BorderThickness="7,7,7,7" CornerRadius="2,2,2,2" BorderBrush="{StaticResource Office_BlackPictureFrame}"
                                    <Border Margin="-1,-1,-1,-1" Width="Auto" BorderBrush="#FFFFFFFF" BorderThickness="1,1,1,1" CornerRadius="2,2,2,2"
                                        <Border BorderThickness="1,1,1,1" CornerRadius="1,1,1,1" Background="#FFFFFFFF"
                                            <Border.BorderBrush> 
                                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"
                                                    <GradientStop Color="#FF2F2F2F" Offset="1"/> 
                                                    <GradientStop Color="#FF515151" Offset="0.008"/> 
                                                </LinearGradientBrush> 
                                            </Border.BorderBrush> 
                                            <!--<telerikGridView:GridViewCell Value="{Binding Picture}" Template="{StaticResource ImageCellTemplate}" />--> 
                                            <Image  Source="/Images/ps/ps1.jpg" Stretch="Fill" /> 
                                        </Border> 
                                    </Border> 
                                </Border> 
                            </Border> 
 
                            <telerikGridView:GridViewCell Value="{Binding AccountName}" Foreground="LightGray" FontSize="12" 
                                                  Grid.Column="0" Grid.ColumnSpan="3" Margin="2,0,2,0" 
                                                  Background="Transparent" BorderThickness="0"  
                                                  VerticalAlignment="Top" HorizontalAlignment="Left" /> 
 
                            <telerikGridView:GridViewCell BorderThickness="0" Grid.Column="2" Grid.Row="1" 
                                    Foreground="White" Value="{Binding UserDisplayName}" Margin="0,2,2,0" 
                                    VerticalAlignment="Top" HorizontalAlignment="Left" /> 
 
                            <telerikGridView:GridViewCell BorderThickness="0" Grid.Column="2" Grid.Row="2" 
                                    Foreground="White" Value="{Binding TimeGeneratedLocal}" Margin="0,2,2,0" 
                                    VerticalAlignment="Top" HorizontalAlignment="Left" /> 
 
                            <telerikGridView:GridViewCell BorderThickness="0" Grid.Column="2" Grid.Row="3" 
                                    Foreground="White" Value="{Binding Description}" Margin="0,2,2,0" 
                                    VerticalAlignment="Top" HorizontalAlignment="Left"
                                <telerikGridView:GridViewCell.Template> 
                                    <ControlTemplate> 
                                        <TextBlock TextWrapping="Wrap" Width="500" 
                                            Text="{TemplateBinding Content}" /> 
                                    </ControlTemplate> 
                                </telerikGridView:GridViewCell.Template> 
                            </telerikGridView:GridViewCell> 
 
                        </Grid> 
                    </Border> 
                </Border> 
            </ControlTemplate> 
            <Style x:Key="rowStyle" TargetType="telerikGridView:GridViewRow"
                <Setter Property="Template" Value="{StaticResource MyCustomRowTemplate}" /> 
            </Style> 
 
 
            <!--<templates:DefaultChartBarStyleTemplateSelector x:Key="defaultChartBarStyleTemplate"/>--> 
 
 
        </Grid.Resources> 
        <telerikMenu:RadTabControl  x:Name="mStrip" AllowDragReorder="False" > 
 
            <telerikMenu:RadTabItem> 
                <telerikMenu:RadTabItem.Header > 
                    <StackPanel Orientation="Horizontal" > 
                        <Image Source="/Images/Financial.png" Height="16" Width="16" /> 
                        <TextBlock Text="Graph View" Margin="3,0,0,0" /> 
                    </StackPanel> 
                </telerikMenu:RadTabItem.Header> 
                <control:RadChart x:Name="radChart" > 
 
                    <telerikMenu:RadContextMenu.ContextMenu > 
                        <telerikMenu:RadContextMenu x:Name="contextMenu" > 
                            <telerikMenu:RadMenuItem Header="View" x:Name="view"
                                <telerikMenu:RadMenuItem Header="Bar Chart" x:Name="barchart"  > 
                                    <telerikMenu:RadMenuItem.Icon> 
                                        <Image Source="/Images/small/barchart_small.png" /> 
                                    </telerikMenu:RadMenuItem.Icon> 
                                </telerikMenu:RadMenuItem> 
                                <telerikMenu:RadMenuItem Header="Line Chart" x:Name="linechart"
                                    <telerikMenu:RadMenuItem.Icon> 
                                        <Image Source="/Images/small/linechart_small.png" /> 
                                    </telerikMenu:RadMenuItem.Icon> 
                                </telerikMenu:RadMenuItem> 
                                <telerikMenu:RadMenuItem Header="Pie Chart" x:Name="piechart"
                                    <telerikMenu:RadMenuItem.Icon> 
                                        <Image Source="/Images/small/pie_small.png" /> 
                                    </telerikMenu:RadMenuItem.Icon> 
                                </telerikMenu:RadMenuItem> 
                                <telerikMenu:RadMenuItem Header="Doughnut Chart" x:Name="dunutchart"
                                    <telerikMenu:RadMenuItem.Icon> 
                                        <Image Source="/Images/small/doughnut_small.png" /> 
                                    </telerikMenu:RadMenuItem.Icon> 
                                </telerikMenu:RadMenuItem> 
                                <telerikMenu:RadMenuItem Header="Area Chart" x:Name="areachart"
                                    <telerikMenu:RadMenuItem.Icon> 
                                        <Image Source="/Images/small/areachart_small.png" /> 
                                    </telerikMenu:RadMenuItem.Icon> 
                                </telerikMenu:RadMenuItem> 
                            </telerikMenu:RadMenuItem> 
 
                            <telerikMenu:RadMenuItem Header="Refresh" x:Name="refresh"
                                <telerikMenu:RadMenuItem.Icon> 
                                    <Image Source="/Images/small/refresh_small.png" /> 
                                </telerikMenu:RadMenuItem.Icon> 
                            </telerikMenu:RadMenuItem> 
                            <!--<telerikMenu:RadMenuItem Header="Show Report" x:Name="showReport"
                            </telerikMenu:RadMenuItem>--> 
                        </telerikMenu:RadContextMenu> 
                    </telerikMenu:RadContextMenu.ContextMenu> 
                </control:RadChart> 
            </telerikMenu:RadTabItem> 
 
            <telerikMenu:RadTabItem> 
                <telerikMenu:RadTabItem.Header> 
                    <StackPanel Orientation="Horizontal"
                        <Image Source="/Images/Daily_report.png" Height="16" 
                            Width="16" /> 
                        <TextBlock Text="Drill Down View" Margin="3,0,0,0" /> 
                    </StackPanel> 
                </telerikMenu:RadTabItem.Header> 
                <ScrollViewer BorderBrush="Transparent" BorderThickness="0"  ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto" > 
                    <Controls:RadGridView x:Name="radGridViewDataBinding" ScrollMode="RealTime"  IsReadOnly="True"  ShowGroupPanel="False"  
                                      Background="#FF525252" ShowColumnHeaders="False" VerticalGridlinesVisibility="Collapsed"  
                                      AutoGenerateColumns="False" GridLinesVisibility="None" VerticalGridlinesBrush="Transparent"  
                                      RowStyle="{StaticResource rowStyle}" UseAlternateRowStyle="False"
                        <Controls:RadGridView.Columns> 
                            <Controls:GridViewDataColumn UniqueName="AccountName" /> 
                            <Controls:GridViewDataColumn UniqueName="Description" IsSortable="False" /> 
                            <Controls:GridViewDataColumn UniqueName="TimeGeneratedLocal" /> 
                            <Controls:GridViewDataColumn UniqueName="UserDisplayName" /> 
                            <!--<Controls:GridViewDataColumn UniqueName="UnitPrice" DataFormatString="{}{0:c}" />--> 
                        </Controls:RadGridView.Columns> 
                    </Controls:RadGridView> 
                </ScrollViewer> 
            </telerikMenu:RadTabItem> 
        </telerikMenu:RadTabControl> 
    </Grid> 

0
Riz
Top achievements
Rank 1
answered on 20 Oct 2009, 11:33 AM
Grid column width I am setting but this should  not effect the movement of the grid with scroll bar.

horizontal scroll bar is presented properly and moveable as well but the grid does not move with scroll bar.
0
Hristo
Telerik team
answered on 21 Oct 2009, 07:35 AM
Hello Joe,

Can you elaborate more on this issue? I've attached sample project with your xaml and I'm able to scroll both horizontally and vertically.
If this is not your case please open support ticket and attach your project.

Please note that when RadGridView is placed inside ScrollViewer you will lose virtualization because the RadGridView is measured with infinity.

Best wishes,
Hristo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Riz
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Riz
Top achievements
Rank 1
Share this question
or