This question is locked. New answers and comments are not allowed.
Hello,
I am testing the RadGridView Ria Services demo using my own DomainDataSource and am encountering a different result than the one in your demo when using the filters.
When I filter the data using any column it will filter the data of the current page I am on instead of reloading the entire dataset. Would you know what could be causing this?
Basically I have 118 pages of data before filtering and 118 pages of data after filtering but the filter is applied on a page basis. The data doesn't reload like it does on your demo.
Here is my code:
Thank you in advance for your help.
Didier
I am testing the RadGridView Ria Services demo using my own DomainDataSource and am encountering a different result than the one in your demo when using the filters.
When I filter the data using any column it will filter the data of the current page I am on instead of reloading the entire dataset. Would you know what could be causing this?
Basically I have 118 pages of data before filtering and 118 pages of data after filtering but the filter is applied on a page basis. The data doesn't reload like it does on your demo.
Here is my code:
| <Grid x:Name="LayoutRoot"> |
| <Grid.RowDefinitions> |
| <RowDefinition /> |
| <RowDefinition Height="30" /> |
| </Grid.RowDefinitions> |
| <riaControls:DomainDataSource LoadingData="DomainDataSource1_LoadingData" LoadedData="DomainDataSource1_LoadedData" x:Name="lookupListDataSource" QueryName="GetLookupsQuery" AutoLoad="True"> |
| <riaControls:DomainDataSource.DomainContext> |
| <ds:Context/> |
| </riaControls:DomainDataSource.DomainContext> |
| <riaControls:DomainDataSource.FilterDescriptors> |
| <riaData:FilterDescriptorCollection LogicalOperator="Or" /> |
| </riaControls:DomainDataSource.FilterDescriptors> |
| </riaControls:DomainDataSource> |
| <controls:RadGridView x:Name="RadGridView1" AutoGenerateColumns="False" Width="520" Height="Auto" MinHeight="100" ItemsSource="{Binding Data, ElementName=lookupListDataSource}"> |
| <controls:RadGridView.Columns> |
| <controls:GridViewDataColumn UniqueName="Description" Header="Description" /> |
| <controls:GridViewDataColumn UniqueName="Type" Header="Type" /> |
| </controls:RadGridView.Columns> |
| </controls:RadGridView> |
| <data:DataPager Grid.Row="1" Width="520" PageSize="8" Source="{Binding Data, ElementName=lookupListDataSource}"></data:DataPager> |
| </Grid> |
| public partial class ExcelExport : Page |
| { |
| public ExcelExport() |
| { |
| InitializeComponent(); |
| } |
| private void DomainDataSource1_LoadingData(object sender, System.Windows.Controls.LoadingDataEventArgs e) |
| { |
| RadGridView1.IsBusy = true; |
| } |
| private void DomainDataSource1_LoadedData(object sender, System.Windows.Controls.LoadedDataEventArgs e) |
| { |
| RadGridView1.IsBusy = false; |
| } |
| private void AddDomainDataSourceFilterDescriptor(Telerik.Windows.Data.FilterDescriptor descriptor) |
| { |
| System.Windows.Data.FilterDescriptor fd = new System.Windows.Data.FilterDescriptor(); |
| fd.PropertyPath = descriptor.Member; |
| fd.Value = new System.Windows.Data.Parameter() { Value = descriptor.Value }; |
| fd.Operator = (System.Windows.Data.FilterOperator)Enum.Parse(typeof(System.Windows.Data.FilterOperator), descriptor.Operator.ToString(), true); |
| lookupListDataSource.FilterDescriptors.Add(fd); |
| } |
| private void RemoveDomainDataSourceFilterDescriptor(Telerik.Windows.Data.FilterDescriptor descriptor) |
| { |
| System.Windows.Data.FilterDescriptor fd = |
| (from d in lookupListDataSource.FilterDescriptors |
| where d.PropertyPath == descriptor.Member && |
| d.Operator == (System.Windows.Data.FilterOperator)Enum.Parse(typeof(System.Windows.Data.FilterOperator), descriptor.Operator.ToString(), true) && |
| d.Value.Value == descriptor.Value |
| select d).FirstOrDefault(); |
| if (fd != null) |
| { |
| lookupListDataSource.FilterDescriptors.Remove(fd); |
| } |
| } |
| private void RadGridView1_Filtering(object sender, Telerik.Windows.Controls.GridView.GridViewFilteringEventArgs e) |
| { |
| using (lookupListDataSource.DeferLoad()) |
| { |
| foreach (Telerik.Windows.Data.FilterDescriptor d in e.RemovedDescriptors) |
| { |
| RemoveDomainDataSourceFilterDescriptor(d); |
| } |
| foreach (Telerik.Windows.Data.FilterDescriptor d in e.AddedDescriptors) |
| { |
| AddDomainDataSourceFilterDescriptor(d); |
| } |
| } |
| } |
| // Executes when the user navigates to this page. |
| protected override void OnNavigatedTo(NavigationEventArgs e) |
| { |
| } |
| } |
Thank you in advance for your help.
Didier
