Can we filter the entire grid based on any child grid colum

2 posts, 0 answers
  1. Ujjawal
    Ujjawal avatar
    1 posts
    Member since:
    Feb 2015

    Posted 23 Feb 2015 Link to this post

    Hi. i am quite new to telerik controls. i have a hierarchical datagrid where i am using a dataset to bind the grid that has two data table. Orders and OrderProducts.  Order is parent grid and OrderProduct is child grid. Filter work well on child grid but it works on only child rows.

    I want to show only those orders in the grid where OrderProducts.productstatus = 'something'. Currently i am using code as below.

                dgOrders.DataSource = ds.Tables[0];
                GridViewTemplate template = new GridViewTemplate();
                template.DataSource = ds.Tables[1];
                GridViewRelation relation = new GridViewRelation(dgOrders.MasterTemplate);
                relation.ChildTemplate = template;
                relation.RelationName = "OrderProducts";

    Any help is really appriciated.
  2. Dimitar
    Dimitar avatar
    1326 posts

    Posted 26 Feb 2015 Link to this post

    Hello Ujjawal,

    Thank you for writing.

    In RadGridView the filtering works per template and to achieve the desired functionality you should add a filter descriptor to the child template. For example:
    GridViewTemplate template = new GridViewTemplate();
    template.DataSource = nwindDataSet.Products;
    template.EnableFiltering = true;
    FilterDescriptor filter = new FilterDescriptor();
    filter.PropertyName = "CategoryID";
    filter.Operator = FilterOperator.IsEqualTo;
    filter.Value = 2;

    I hope this helps. Should you have any other questions do not hesitate to ask.


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

  3. DevCraft R3 2016 release webinar banner
Back to Top