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

RadGrid - Nested grid using nestedviewtemplate

3 Answers 141 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Arathi
Top achievements
Rank 1
Arathi asked on 22 Mar 2013, 10:51 AM
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

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 25 Mar 2013, 05:08 AM
Hi,

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

Thanks,
Shinu.
0
Arathi
Top achievements
Rank 1
answered on 25 Mar 2013, 08:03 AM
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.


0
Kostadin
Telerik team
answered on 27 Mar 2013, 09:56 AM
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.
Tags
General Discussions
Asked by
Arathi
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Arathi
Top achievements
Rank 1
Kostadin
Telerik team
Share this question
or