Sorting RadGridView and data virtualization

4 posts, 0 answers
  1. elad
    elad avatar
    1 posts
    Member since:
    Nov 2015

    Posted 29 Nov 2015 Link to this post

    hello, i have a problem with my project.

    i am using 2013 version of telerik,

    i have a RadGridView with about 40-50 records , which spread across 2-3 pages.

    i want to sort them by a column, but due to lazy loading it sorts only the specific page i am in.

    i  have tried to disable lazy loading by using the command EnableRowVirtualization="false", but without success.

    does any newer version have a solution to this problem, or any other solution?

    thank you very much,

    elad.

  2. Stefan X1
    Admin
    Stefan X1 avatar
    514 posts

    Posted 02 Dec 2015 Link to this post

    Hello Elad,

    In general, disabling the UI Virtulization of RadGridView is something that we do not recommend as such approach would significantly affect the performance of the control. I suggest you taking a look at the UI Virtualization topic for more information.

    As to your requirement,can you please share some details on how have you implemented the paging of RadGridView and its sorting operation, as such behavior is not reproducible at my side.

    You can take a look at the attached project as a demonstration. Can you please elaborate on how it defers from your implementation?

    Additionally, for paging RadGridView you can check out the RadDataPager control.

    Regards,
    Stefan
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
  4. Einav
    Einav avatar
    1 posts
    Member since:
    Dec 2015

    Posted 08 Dec 2015 in reply to Stefan X1 Link to this post

    Hello Stefan,

    I am Elad CoWorker,

    In our code we did use RadDataPager with no succes.

    this is our code:

     

    ......

    <telerik:RadDataPager
    HorizontalAlignment="Stretch"
    DisplayMode="FirstLastPreviousNextNumeric,Text"
    IsTotalItemCountFixed="True"
    PageSize="30"
    SelectiveScrollingGrid.SelectiveScrollingOrientation="Both"
    Source="{Binding Items, ElementName=GridView}" />
    <!-- Scenarios List -->
    <telerik:RadGridView x:Name="GridView"
     HorizontalAlignment="Stretch"
    VerticalAlignment="Stretch"
    AutoGenerateColumns="False"
    CanUserFreezeColumns="False"
    CanUserReorderColumns="False"
    DataContext="{Binding UpdateSourceTrigger=PropertyChanged, Mode=OneWay}"
    DataLoadMode="Synchronous"
    GridLinesVisibility="Horizontal"
    helpers:GridViewHeaderMenu.IsEnabled="True"
    IsBusy="False"
    IsReadOnly="True"
    IsSynchronizedWithCurrentItem="True"
    ItemsSource="{Binding ScenariosDataSetFiltered, UpdateSourceTrigger=PropertyChanged}"
    Keyboard.KeyUp="GridView_KeyUp"
    ReorderColumnsMode="None"
    RowActivated="GridView_RowActivated"
    RowIndicatorVisibility="Collapsed"
    ScrollMode="RealTime"
    SelectedItem="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type y:C2ViewControl}},Path=ScenariosListViewPresenter.CurrentScenario,Mode=TwoWay}"
    SelectionMode="{Binding Converter={ StaticResource ModeToGridSelectionModeConverter }, Path=TranslationObject.MultiSelectionEnableModesList}"
    SelectionUnit="FullRow"
    ShowGroupPanel="False">
    <telerik:RadContextMenu.ContextMenu>
    <telerik:RadContextMenu IsEnabled="{Binding SessionStartSharingService.IsEnabledUI}"
    Opened="RadContextMenu_Opened"
    Visibility="{Binding IsContextMenuVisible, Converter={StaticResource booleanToVisibilityConverter}}">
    <telerik:RadContextMenu.Items>
    <telerik:RadMenuItem Command="{Binding EditCommand}"
    Header="Edit" />
    <telerik:RadMenuItem Command="{Binding RenameCommand}"
    Header="Rename" />
    <telerik:RadMenuItem Command="{Binding SaveAsCommand}"
    Header="Duplicate" />
    <telerik:RadMenuItem Command="{Binding DeleteCommand}"
    Header="Delete" />
    </telerik:RadContextMenu.Items>
    </telerik:RadContextMenu>
    </telerik:RadContextMenu.ContextMenu>
    <telerik:RadGridView.Columns>
    <telerik:GridViewDataColumn Header="Scenario Name"
    IsFilterable="True"
    translation:TranslateExtension.Uid="IOS.MT.Modules.ScenariosModule.ScenarioslistView.ScenarioNameCol"
    UniqueName="Name"
    SortMemberPath="Name"
    >
    <telerik:GridViewDataColumn.CellTemplate>
    <DataTemplate>
    <TextBlock Text="{Binding Name,UpdateSourceTrigger=PropertyChanged}" />
    </DataTemplate>
    </telerik:GridViewDataColumn.CellTemplate> 

    ..... 

    Any sugestion?

    Thanks a lot,

    Einav

     

     

  5. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 11 Dec 2015 Link to this post

    Hi Einav,

    Can you check out the project my colleague previously attached? It illustrates how you can work with RadGridView together with RadDataPager successfully. Furthermore, you can run through the "Using Telerik RadDataPager" article for more information.


    Regards,
    Maya
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
Back to Top