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

Custom filter row not shown when using RadDomainDataSource/ria:DomainDataSource to supply the ItemsSource for radGridView

1 Answer 41 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Edward Pauley
Top achievements
Rank 1
Edward Pauley asked on 14 Mar 2011, 07:23 PM
Hi

We need your custom filter row like the one in the demo for our radgridview. It is a very IMPORTANT feature for us.
http://demos.telerik.com/silverlight/#GridView/CustomFilterRow
I already included all of the codes in your demo for my project.(i downloaded them on 03-08-2011. So i supposed that it is the Latest demo version)
However, when i run it by using the radDomainDataSource to supply the itemsSource for my radgridview and it has never shown the custom filter row at all. We need to retrieve the collection of data through our database server
After reading some related posts in the forum, i do know that the custom filter needs to know the collection type in order to generated the corresponding type of the filter header. However, isn't that you already fix that issue by  using (in your newest version code)
public CustomFilterRow(RadGridView radGridView)
       {
           this.radGridView = radGridView;
           this.radGridView.IsFilteringAllowed = false;
           this.radGridView.DataLoaded += this.radGridView_DataLoaded;
       }
 
       private void radGridView_DataLoaded(object sender, EventArgs e)
       {
           this.filteringRow = new FilteringRow();
           this.filteringRow.Loaded += this.FilteringRow_Loaded;
 
           this.radGridView.RowLoaded += this.radGridView_RowLoaded;
           this.radGridView.ColumnDisplayIndexChanged += this.ReorderFilterCells;
           this.radGridView.Grouped += this.Grouped;
 
           this.radGridView.DataLoaded -= this.radGridView_DataLoaded;
       }


Plz help.
thank

my codes:
A snippet of my radgridview 
NOTE: i even try to set the itemsSource  of the radgridview in the code behind on the LoadedData event of the radDomainDataSource but also no luck
<telerik:RadGridView
                                   filter:CustomFilterRow.IsEnabled="True"
                                   Background="Gainsboro" IsBusy="{Binding IsBusy,ElementName=unSelectedDocumentARInfoDomainDataSource}"
                                 Name="unSelectedDocumentARInfoRadGridView"
                                 IsEnabled="False"
                                 AutoGenerateColumns="False"
                                 ItemsSource="{Binding Path=DataView,ElementName=unSelectedDocumentARInfoDomainDataSource}"
                                 ShowColumnFooters="True"
                                 IsSynchronizedWithCurrentItem="true"
                                   CanUserDeleteRows="False"
                                 CanUserInsertRows="False"
                                 RowEditEnded="unSelectedDocumentARInfoRadGridView_RowEditEnded"
                                CellValidating="unSelectedDocumentARInfoRadGridView_CellValidating"
                                 ShowGroupPanel="False"
                                   
                                >
               <telerik:RadGridView.Columns>
                   <telerik:GridViewDataColumn DataMemberBinding="{Binding DocumentDate,Mode=TwoWay}" Header="Document Date" DataFormatString="{}{0:d}" IsReadOnly="True" />
                   <telerik:GridViewDataColumn DataMemberBinding="{Binding DocumentARInfoNumber,Mode=TwoWay}" Header="Number" IsReadOnly="True" />
                   <telerik:GridViewDataColumn DataMemberBinding="{Binding OriginalAmount,Mode=TwoWay}" Header="Orig Amount" IsReadOnly="True"  DataFormatString="{}{0:c2}">
                       <telerik:GridViewDataColumn.Footer>
   
                           <TextBlock Text="Total:" />
   
   
                       </telerik:GridViewDataColumn.Footer>
                   </telerik:GridViewDataColumn >
                      
                   <telerik:GridViewDataColumn DataMemberBinding="{Binding DocumentBalance,Mode=TwoWay}" Header="Amount Due" IsReadOnly="True"  DataFormatString="{}{0:c2}">
                       <telerik:GridViewDataColumn.AggregateFunctions>
                           <telerik:SumFunction SourceField="DocumentBalance" ResultFormatString="{}{0:c2}" />
                       </telerik:GridViewDataColumn.AggregateFunctions>
                       <telerik:GridViewDataColumn.Footer>
                           <telerik:AggregateResultsList ItemsSource="{Binding}" />
                       </telerik:GridViewDataColumn.Footer>
                   </telerik:GridViewDataColumn>
   
                   <telerik:GridViewDataColumn DataMemberBinding="{Binding PaymentAmount,Mode=TwoWay}" Header="Payment" UniqueName="Payment"   DataFormatString="{}{0:c2}" >
                       <telerik:GridViewDataColumn.AggregateFunctions>
                           <telerik:SumFunction SourceField="PaymentAmount" ResultFormatString="{}{0:c2}" />
                       </telerik:GridViewDataColumn.AggregateFunctions>
                       <telerik:GridViewDataColumn.Footer>
                           <telerik:AggregateResultsList ItemsSource="{Binding}" />
                       </telerik:GridViewDataColumn.Footer>
                   </telerik:GridViewDataColumn>
                      
                      
               </telerik:RadGridView.Columns>
           </telerik:RadGridView>
           <telerik:RadDomainDataSource AutoLoad="True" LoadingData="unSelectedDocumentARInfoDomainDataSource_LoadingData" Height="0" LoadedData="unSelectedDocumentARInfoDomainDataSource_LoadedData" Name="unSelectedDocumentARInfoDomainDataSource" QueryName="GetUnSelectedDocumentARInfoForDepositPostingQuery" Width="0" Margin="0,0,729,124">
                 
               <telerik:RadDomainDataSource.QueryParameters>
                   <telerik:QueryParameter ParameterName="businessEntityId" Value="{Binding ElementName=businessEntityIdRCB,Path=SelectedItem.BusinessEntityId,Mode=OneWay}" />
                       <telerik:QueryParameter ParameterName="paymentDocumentARInfoId" Value="{Binding ElementName=documentARInfoIdTB,Path=Text,Mode=OneWay}"/>
                   </telerik:RadDomainDataSource.QueryParameters>
                      
                          
               </telerik:RadDomainDataSource>

A snippet of my service on the .web project

public IQueryable<DocumentARInfo> GetUnSelectedDocumentARInfoForDepositPosting(int businessEntityId,string paymentDocumentARInfoId)
      {
          //need to check the businessEntityId = 0 in order to cancel the initial load
          //when the screen has FIRST been opened
          if (businessEntityId == 0)
          {
              return null;
   
          }
          else
          {
              int? paymentDocumentARInfoIdTOInt;
              if (paymentDocumentARInfoId == null || paymentDocumentARInfoId == "")
              {
                  paymentDocumentARInfoIdTOInt = null;
              }
              else
              {
                  paymentDocumentARInfoIdTOInt = Int32.Parse(paymentDocumentARInfoId);
              }
              var result = this.ObjectContext.DocumentARInfoes.Where(a => a.BusinessEntityId == businessEntityId && a.PostingStatusId == 2 && a.DocumentBalance != 0 && a.DocumentType.OriginalDocumentType == 1 && (a.PaymentDocumentARInfoId == paymentDocumentARInfoIdTOInt || a.PaymentDocumentARInfoId == null));
   
              return result;
          }
      }


thanks

1 Answer, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 15 Mar 2011, 03:01 PM
Hello Edward Pauley,

This example was created several years before RadDomainDataSource came into existence and was never designed to work with data coming (later) asynchronously from the server, which is the case with RDDS. It depend on the fact that the grid will be populated immediately, which is not the case when you have RDDS. 

I am afraid that it cannot be easily integrated with RadDomainDataSource, because its whole design is just not suited for that. Maybe we will integrate the custom filter row as a built-in feature of RadGridView one day and then it will be able to work with RDDS. However, I cannot commit to such a feature. The Custom Filter Row is just an example, it is not an official product that we actively support.

My suggestion would be to either use RadGridView's built-in filtering UI or RadDataFilter. Both of them will integrate with RDDS without a single line of code and do the filtering directly on the server.

I hope this helps.

Greetings,
Ross
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
GridView
Asked by
Edward Pauley
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Share this question
or