This question is locked. New answers and comments are not allowed.
I have what i beleive to be a bug (2012.2.607.1050 version)
although it could be the way i am doing it
I needed a button that would clear all the filters that have been set up on a radgridview that was
fed by a domaindatasource/pager
I used code that was posted by the admin Ross for clearing the filters
What i found was some unusal behavior where multiple loads were being started on the DDS.
In an effort to demonstarte this behavior i authored a short demo/test against the northwind database
I removed the domaindatasource and replaced it with a QueryableDomainServiceCollectionView
if you filter a number of columns
Then change the page to 2 or 3 or any page except the first one
Press the clear button.
Multiple loads will be started and completed
See code and Debug Output below
is there somehting i am doing wrong
is there a better way
is it a bug (i think so)
thanks
dco
although it could be the way i am doing it
I needed a button that would clear all the filters that have been set up on a radgridview that was
fed by a domaindatasource/pager
I used code that was posted by the admin Ross for clearing the filters
Private Sub btnClear_Click(sender As Object, e As System.Windows.RoutedEventArgs) Handles btnClear.Click radGridView.FilterDescriptors.SuspendNotifications() For Each column In radGridView.Columns If column.FilteringControl IsNot Nothing Then Else column.ClearFilters() End If Next radGridView.FilterDescriptors.ResumeNotifications()End SubWhat i found was some unusal behavior where multiple loads were being started on the DDS.
In an effort to demonstarte this behavior i authored a short demo/test against the northwind database
I removed the domaindatasource and replaced it with a QueryableDomainServiceCollectionView
if you filter a number of columns
Then change the page to 2 or 3 or any page except the first one
Press the clear button.
Multiple loads will be started and completed
See code and Debug Output below
is there somehting i am doing wrong
is there a better way
is it a bug (i think so)
thanks
dco
<UserControl x:Class="agTesty6.MainPage" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"> <Grid x:Name="LayoutRoot"> <Grid.RowDefinitions> <RowDefinition Height="*" /> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> <telerik:RadGridView x:Name="radGridView" Grid.Row="0" ItemsSource="{Binding DataView}" ShowGroupPanel="False" AutoGeneratingColumn="OnRadGridViewAutoGeneratingColumn" IsReadOnly="True"/> <telerik:RadDataPager x:Name="radDataPager" PageSize="10" Grid.Row="1" AutoEllipsisMode="Both" NumericButtonCount="10" Source="{Binding DataView}" DisplayMode="All" IsTotalItemCountFixed="True"/> <Button Content="Clear" Grid.Row="2" Margin="4" Width="75" HorizontalAlignment="Right" x:Name="btnClear" /> </Grid></UserControl>Imports SystemImports System.LinqImports System.Windows.ControlsImports Telerik.Windows.Controls.DomainServicesImports Telerik.Windows.DataPartial Public Class MainPage Inherits UserControl Public Sub New() InitializeComponent() Dim domainContext As New agTesty6.Web.NorthWindDomainContext Dim query = domainContext.GetCustomers_OrderedQuery _DataView = New QueryableDomainServiceCollectionView(Of agTesty6.Web.Customer)(domainContext, query) Me.DataContext = Me _DataView.AutoLoad = True End Sub Public ReadOnly Property DataView() As QueryableCollectionView Get Return _DataView End Get End Property Private WithEvents _DataView As QueryableDomainServiceCollectionView(Of agTesty6.Web.Customer) Private Sub OnRadGridViewAutoGeneratingColumn(sender As System.Object, e As Telerik.Windows.Controls.GridViewAutoGeneratingColumnEventArgs) End Sub Private Sub btnClear_Click(sender As Object, e As System.Windows.RoutedEventArgs) Handles btnClear.Click radGridView.FilterDescriptors.SuspendNotifications() For Each column In radGridView.Columns If column.FilteringControl IsNot Nothing Then Else column.ClearFilters() End If Next radGridView.FilterDescriptors.ResumeNotifications() End Sub Private Sub _DataView_LoadedData(sender As Object, e As Telerik.Windows.Controls.DomainServices.LoadedDataEventArgs) Handles _DataView.LoadedData System.Diagnostics.Debug.WriteLine("Dataview Loaded Data -- " & e.Entities.Count) End Sub Private Sub _DataView_LoadingData(sender As Object, e As Telerik.Windows.Controls.DomainServices.LoadingDataEventArgs) Handles _DataView.LoadingData System.Diagnostics.Debug.WriteLine("======================") System.Diagnostics.Debug.WriteLine("Dataview Loading Data") System.Diagnostics.Debug.WriteLine(e.Query.Query) End SubEnd Class======================Dataview Loading DataagTesty6.Web.Customer[].Where(item => item.CompanyName.ToLower().Contains("s".ToLower())).Skip(30).Take(10)Dataview Loaded Data -- 10======================Dataview Loading DataagTesty6.Web.Customer[].Take(10)======================Dataview Loading DataagTesty6.Web.Customer[].Take(10)======================Dataview Loading DataagTesty6.Web.Customer[].Skip(30).Take(10)Dataview Loaded Data -- 10Dataview Loaded Data -- 10Dataview Loaded Data -- 10