RadGrid - Nested grid using nestedviewtemplate

4 posts, 0 answers
  1. Arathi
    Arathi avatar
    2 posts
    Member since:
    Mar 2013

    Posted 22 Mar 2013 Link to this post

    Hi,

      I have scenario here where in I have a List of Employess and each employee in turn has a List of Projects.I have created a master grid with its nestedviewtemplate having a child grid  to display the each employee and his associated projects.
    i.e We will have a collapsible option for the master grid and expanding it,it would display the projects associated for that particular employee.This works fine.

    Now,for my second scenario,I need to display all projects irrespective of employee using the same grid having nestedviewtemplate.In this case,I should not be having the collapsible option,and it should load the grid with all projects.

    how do I achieve the second scenario without the collapsible symbol with data being loaded on load.

    Thanks
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 25 Mar 2013 Link to this post

    Hi,

    You can try the approach mentioned in the following demo.
    Grid - Master/Detail Grids

    Thanks,
    Shinu.
  3. Arathi
    Arathi avatar
    2 posts
    Member since:
    Mar 2013

    Posted 25 Mar 2013 Link to this post

    Thanks.

    But what I was looking for was a way in which I could use the same Nested grid just to show all the projects across all employess.

    I have telerik grid .i.e master grid. and also I have placed another grid i.e child grid  inside the nestedviewtemplate of master grid  so that I can make use of the collapsible option available.
    I have two scenarios to display:
    i)Display emplyee and his specific projects.This works fine.I can show each employee and clicking on the collapse option,I can expand and load the child grid containing his specific projetcs.This works fine.
    ii)Second scenario is when I need to display all the projects for all employees using the same master grid-child grid.In this scenario I dont want to show the collapsible option and also I want the grid to be expanded during load only.I see no option to make use of the same master-child grid to accomplish this second scenario.


  4. Kostadin
    Admin
    Kostadin avatar
    1733 posts

    Posted 27 Mar 2013 Link to this post

    Hi Arathi,

    A possible solution is to expand all items and hide the ExpandColumn. You could achieve that by setting MasterTableView's HierarchyDefaultExpanded property to true and hide the column OnPreRender event handler. Check out the following code snippet.
    protected void RadGrid1_PreRender(object sender, EventArgs e)
        {
            if (RadGrid1.MasterTableView.HierarchyDefaultExpanded)
            {
                RadGrid1.MasterTableView.GetColumn("ExpandColumn").Visible = false;
            }
        }

    Greetings,
    Kostadin
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top