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

Filtering whole data when raddatapager and radgridview used together

2 Answers 83 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mahmut
Top achievements
Rank 2
Mahmut asked on 28 Sep 2011, 01:09 PM
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 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 30 Sep 2011, 06:47 AM
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 >>

0
Mahmut
Top achievements
Rank 2
answered on 01 Oct 2011, 12:42 PM

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

Tags
GridView
Asked by
Mahmut
Top achievements
Rank 2
Answers by
Vlad
Telerik team
Mahmut
Top achievements
Rank 2
Share this question
or