Problem with RadDataFilter

2 posts, 0 answers
  1. KSafadi
    KSafadi avatar
    11 posts
    Member since:
    Oct 2012

    Posted 23 May 2017 Link to this post

    Hello,

    I have bound a GridView to a bindingsource. The bindingsource are based on the entity frame work and will be set with the following code:

     bsDetekEingabePos.DataSource = (From DetektorPos As tblDetekEingabePos In dbContext.tblDetekEingabePos                                                           Order By DetektorPos.Id Where DetektorPos.SN = "4711" And DetektorPos.VarianteNr = 1
                                   
    Select DetektorPos).ToList

     

    Now I have placed a DataFilter element on my form wich has the same datasource like the grid. I also have implemented the code:

    Private Sub RadDataFilter1_Edited_1(sender As Object, e As TreeNodeEditedEventArgs) Handles RadDataFilter1.Edited        RadDataFilter1.ApplyFilter() 
     End Sub

     

    But when I select a filter in the DataFilter nothing happens. The grid shows the same data then before.
    Do you have any idea what the problem can be?

    Thank's in advance
    Karim

  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3532 posts

    Posted 24 May 2017 Link to this post

    Hello Karim, 

    Thank you for writing.  
     
    I would recommend you to have a look at the Demo application >> Data Filter >> First look example which demonstrates how to filter the grid through the RadDataFilter. The RadDataFilter.DataSource property must implement IBindingListView. That is why you can use a BindingSource for the DataSource property of RadGridView and RadDataFilter. However, every BindingSource has a property SupportsFiltering. In case you set an entity set as BindingSource.DataSource, these two properties are automatically set to false. Please refer to the following StackOverflow thread demonstrating a sample approach how you can filter the BindingSource filled with entities: https://stackoverflow.com/questions/12125037/use-filter-of-bindingsource-with-entity-framework

    I hope this information helps. Should you have further questions I would be glad to help.

    Regards,
    Dess
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top