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

Scrolling RadGridView with RadDataPager

2 Answers 173 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Florian
Top achievements
Rank 1
Florian asked on 19 Jul 2011, 02:07 PM
Hello telerik team

I have a question:
I am using your RadGridView with a RadDataPager. I am wondering if vertical scolling is still possible if the data is paged? The problem occurs when i am resizing the window ... The size of the RadGridView is kind of fixed now.

Can you help me solving this issue?

Here my code:

<telerik:RadGridView x:Name="DataGrid"
                         ItemsSource="{Binding PagedSource, ElementName=radDataPager}"
                         SelectedItem="{Binding MandantOverviewSelected}"
                         AutoGenerateColumns="False"
                         GridLinesVisibility="None"
                         CanUserDeleteRows="False"
                         CanUserInsertRows="False"
                         IsReadOnly="True"
                         CanUserSortColumns="True"
                         ShowGroupPanel="True"
                         AlternationCount="2"
                         ShowColumnHeaders="True"
                         RowIndicatorVisibility="Collapsed"
                         CanUserFreezeColumns="False"
                         FontSize="11"
                         VerticalAlignment="Stretch">
        <telerik:RadGridView.Columns>
            <telerik:GridViewDataColumn DataMemberBinding="{Binding MandantNummer}" Header="{x:Static LocalResources:ResSystemKonfigurationMandanten.Mandanten_ColumnTitle_MandantNummer}" DataType="{x:Type System:String}" Width="25*"/>
            <telerik:GridViewDataColumn DataMemberBinding="{Binding Bezeichnung}" Header="{x:Static LocalResources:ResSystemKonfigurationMandanten.Mandanten_ColumnTitle_Bezeichnung}" DataType="{x:Type System:String}" Width="25*" />
            <telerik:GridViewDataColumn DataMemberBinding="{Binding Typ}" Header="{x:Static LocalResources:ResSystemKonfigurationMandanten.Mandanten_ColumnTitle_Typ}" DataType="{x:Type System:String}" Width="25*" />
            <telerik:GridViewDataColumn DataMemberBinding="{Binding DefaultspracheText}" Header="{x:Static LocalResources:ResSystemKonfigurationMandanten.Mandanten_ColumnTitle_Defaultsprache}" DataType="{x:Type System:String}" Width="25*" />
        </telerik:RadGridView.Columns>
    </telerik:RadGridView>
<telerikGrid:RadDataPager x:Name="radDataPager"
                         PageSize="10"
                         IsTotalItemCountFixed="True"
                          DisplayMode="FirstLastPreviousNextNumeric"
                         Source="{Binding MandantOverviewList}"/>
    </StackPanel>

2 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 19 Jul 2011, 02:17 PM
Hi Florian,

RadGridView and RadDataPager do not know about each other. So when RadGridView is bound to RadDataPager.PagedSource it is as though it is bound to a collection which size is equal to the PageSize. When the pager changes its pages, it is as though this collection changes all of its elements with new ones.

But RadGridView does not actually know what is going on and that there is a pager which feeds data to it.

So vertical scrolling has nothing to do with RadDataPager. If the items that RadGridView displays (i.e. PageSize) are more than the viewable area, then a vertical scroll-bar will appear.

I hope this makes sense.

Greetings,
Ross
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Florian
Top achievements
Rank 1
answered on 20 Jul 2011, 10:11 AM
Hi Ross

Yes absolutely! Again the error was a "stupid" - one: I used as container a StackPanel ... instaid of using a DockPanel!
That's all, now it works! Sorry for that and thank you for your Answer.

Have a nice Day
Florian
Tags
GridView
Asked by
Florian
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Florian
Top achievements
Rank 1
Share this question
or