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

GridView vertical scroll bar disabled

1 Answer 417 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Oren
Top achievements
Rank 1
Oren asked on 25 Jan 2012, 04:16 PM
Hi
I'm creating a GridView with a large number of data records.
I'm unable to use the vertical scroll bar, even when I make it visible, it's still disabled.
The horizontal scroll bar becomes visible (and enabled) when I make the window narrow enough.
I've also been unable to link the RadDataPager to the RadGridView.
I wasn't able to find any answer while searching the forums for similar issues.
Thanks


Code : 


        public MainWindow()
        {
            InitializeComponent();
            _productData.ItemsSource = TradeDataProvider.GetProducts();
            _radDataPager.Source = TradeDataProvider.GetProducts();
        }


Xaml :


<telerik:RadRibbonWindow 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    xmlns:EQDDataAdmin="clr-namespace:aaa" 
    x:Class="aaar.MainWindow"
    Title="bbb"
    MinWidth="100"
    WindowStartupLocation="CenterScreen">
    <Grid>
        <DockPanel>
            <Grid x:Name="_TestProductsGrid" VerticalAlignment="Stretch">
                <StackPanel>
                    <telerik:RadDataPager x:Name="_radDataPager"
                          PageSize="10"
                          DisplayMode="FirstLastPreviousNextNumeric, Text"
                          IsTotalItemCountFixed="True" />
                    <telerik:RadGridView  AutoGenerateColumns="False" x:Name="_productData"
                                  VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
                                  EnableRowVirtualization="True"
                                  SelectionMode="Extended"
                                  ScrollViewer.VerticalScrollBarVisibility="Visible">
                        <telerik:RadGridView.Columns>
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding CompanyName}" Header="Company Name"/>
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding CCY}" Header="Currency"/>
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding Country}" Header="Country"/>
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding Region}" Header="Region"/>
                        </telerik:RadGridView.Columns>
                    </telerik:RadGridView>
                </StackPanel>
            </Grid>
            <!--<Grid x:Name="_MainGrid" SizeChanged="MainGridHightChanged"
                  Grid.Row="0" Grid.Column="0" VerticalAlignment="Top">
                <StackPanel VerticalAlignment="Stretch">
                    <EQDDataAdmin:ProductData x:Name="_ProductDataUserControl" VerticalAlignment="Stretch"/>
                </StackPanel>
            </Grid>-->
        </DockPanel>
    </Grid>
</telerik:RadRibbonWindow>


1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 25 Jan 2012, 04:17 PM
Hi,

 The grid in your case will be measured with infinity height since it is inside StackPanel. When measured with infinity every UI virtual component like RadGridView, standard WPF DataGrid, ListBox, etc. will be forced to create all items at once which will lead to huge performance and memory problems.

Please use Grid instead StackPanel to arrange your UI! 

Greetings,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

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