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

Sorting RadGridView and data virtualization

3 Answers 193 Views
GridView
This is a migrated thread and some comments may be shown as answers.
elad
Top achievements
Rank 1
elad asked on 29 Nov 2015, 08:44 AM

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.

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 02 Dec 2015, 03:36 PM
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
0
Einav
Top achievements
Rank 1
answered on 08 Dec 2015, 09:05 AM

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

 

 

0
Maya
Telerik team
answered on 11 Dec 2015, 07:40 AM
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
Tags
GridView
Asked by
elad
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Einav
Top achievements
Rank 1
Maya
Telerik team
Share this question
or