Wrong result by datafilter when using with domain data source

1 posts, 0 answers
  1. Manoj
    Manoj avatar
    43 posts
    Member since:
    Aug 2011

    Posted 08 Sep 2011 Link to this post

    I have added 2 filters as shown in attached image. When you delete both very fast. it removes only first deleted filter from result records. It doesn't corrects record as per secound deleted filter(Deleted filter before reloading grid as a risult of first filter delete). 
    How to fix this issue. Please suggest.

    XAML code

    <!—UnBound mode Filter-->

                                                            <telerik:RadDataFilter Grid.Column="0" HorizontalAlignment="Left" Name="radDataFilter"

                                   MinHeight="150" MaxHeight="150"

                                   EditorTemplateSelector="{StaticResource redEditorTemplateSelector}"

                                                       Margin="1">

                                                            </telerik:RadDataFilter>

     

    <!--DomainService-->

    <telerik:RadDomainDataSource x:Name="domainDataSource1" AutoLoad="True"

                                        QueryName="GetVW_AuditAssignments" LoadingData="domainDataSource1_LoadingData"

                                                                   PageSize="30">

                                                <telerik:RadDomainDataSource.DomainContext>

                                                    <s:BriteDomainContext />

                                                </telerik:RadDomainDataSource.DomainContext>

                                            </telerik:RadDomainDataSource>

    <!—Busy Indicator-->

    <telerik:RadBusyIndicator IsBusy="{Binding IsBusy, ElementName=domainDataSource1}" >

     

    <!--Grid-->

                                            <telerik:RadGridView MinHeight="370" MaxHeight="370" MaxWidth="1150" x:Name="radGridView" AutoGenerateColumns="False" ItemsSource="{Binding DataView, ElementName=domainDataSource1}"

                                                          CanUserFreezeColumns="True" SelectionMode="Extended" IsReadOnly="True" SelectionUnit="FullRow">

                                                <telerik:RadGridView.Columns>

                                                    <telerik:GridViewDataColumn  DataMemberBinding="{Binding AuditAssignmentID}" Header="AuditAssignmentID" IsVisible="False"/>

                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding ExpirationDate_CancellationDate}" Header="Expiration/Cancellation Date" DataFormatString="{}{0:d}" UniqueName="AssignmentStartDate" IsGroupable="False"    />

                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding IsFlatCancelled}" Header="Is Flat Cancelled" IsGroupable="False"    />

    .

    .

    .more columns

                                                </telerik:RadGridView.Columns>

                                            </telerik:RadGridView>

     

                                            </telerik:RadBusyIndicator>

    <!--Pager-->

     

                                            <telerik:RadDataPager

                                                              x:Name="radDataPager1"

                                                              PageSize="30"  MaxWidth="1150"

                                                              Source="{Binding Items, ElementName=radGridView}"

                                                              DisplayMode="All"

                                                              AutoEllipsisMode="Both"

                                                              NumericButtonCount="10"

                                                              IsTotalItemCountFixed="True"/>

     

    CodeBehind unbound filter binding

    /// <summary>

            /// Loading Filter data

            /// </summary>

            /// <param name="lstFinalAuditSeachFields"></param>

            private void FilterSettings(List<FinalAuditSeachField> lstFinalAuditSeachFields)

            {

                foreach (var item in lstFinalAuditSeachFields)

                {

                    var nameDefinition = new ItemPropertyDefinition(item.FieldName, Type.GetType(item.FieldType), item.UserFriendlyFieldName);

                    CurrentView.radDataFilter.ItemPropertyDefinitions.Add(nameDefinition);

                }

                CurrentView.radDataFilter.FilterDescriptors.CollectionChanged += this.FilterDescriptors_CollectionChanged;

            }

     

     

            private void FilterDescriptors_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)

            {

                if (e.Action == NotifyCollectionChangedAction.Add)

                {

                    CurrentView.radGridView.FilterDescriptors.AddRange(e.NewItems.OfType<IFilterDescriptor>());

                }

                else if (e.Action == NotifyCollectionChangedAction.Remove)

                {

                    foreach (var item in e.OldItems.OfType<IFilterDescriptor>())

                    {

                        CurrentView.radGridView.FilterDescriptors.Remove(item);

                    }

                }

            }

     

Back to Top