Filtering whole data when raddatapager and radgridview used together

3 posts, 0 answers
  1. Mahmut
    Mahmut avatar
    21 posts
    Member since:
    Nov 2010

    Posted 28 Sep 2011 Link to this post

    Hello,

    I use a PagedCollectionView for RadGridView, and RadDataPager in a page. This pcv is bound to a DomainDataSource.DataView. When I use grid's filter, I see only the distinct values belong to the first page.  So, by filtering a value belongs to another page, the first page become empty. I'm trying to filter whole data (i.e. pcv) and refresh/rebind the radgridview. Is there a way to do that or something like this.
    Thanks in advance.

    Mahmut
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 30 Sep 2011 Link to this post

    Hi Mahmut,

     Please check this demo for more info:
    http://demos.telerik.com/silverlight/#GridView/DomainDataSource

    Regards,
    Vlad
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. Mahmut
    Mahmut avatar
    21 posts
    Member since:
    Nov 2010

    Posted 01 Oct 2011 Link to this post

    Hi Vlad,

    I've looked at that demo. In fact, that's absolutely what i need. But when i used the sample codes, i have encountered an "System.Data.EntitySqlException" in server side (in the below line of "
    this.Object.Documents.Select(propertyName).OfType<string>().Distinct().ToList()"). The exception message is something like " 'System.String' type is not a valid type for filtering... Type filtering is only valid for entity types and complex types...". I think it's used LinqToSqlDomainService in your demo and in your sample project described at "http://blogs.telerik.com/blogs/posts/10-01- 07/ how_to_populate_radgridview_for silverlight_distinct_filters_asynchronously using_wcf_ria services.aspx".
    Is there anything that I've missed or if not, is there any way to do this with LinqToEntitiesDomainService.
     
     

    ...
    public List<DistinctValue> GetDistinctValues(string propertyName)
    {
        var list = new List<DistinctValue>();
        var values = this.ObjectContext.Customers.Select(propertyName).OfType<string>().Distinct().ToList();
        for (var i = 0; i < values.Count; i++)
        {
            list.Add(new DistinctValue() { ID = i, Value = values[i] });
        }
        return list;
    }
    ...
    public class DistinctValue
    {
        [Key]
        public int ID { get; set; }
        public string Value { get; set; }
    }

     

    Thanks.

    Mahmut

Back to Top