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

[Solved] Hierarchical Support within ASP.Net MVC Grid

8 Answers 132 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Michael Strasser
Top achievements
Rank 1
Michael Strasser asked on 04 Nov 2009, 05:49 PM
Is there any support in the ASP.Net MVC Grid for Hierarchical data?
If so, can I get some examples?
What I'm attempting to do is have a child area for each parent row.  The child area will contain tabs for child content.  Enclosed is a picture of a mock-up of what I'd like to accomplish.
Thanks!
M.A.Strasser

8 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 05 Nov 2009, 09:02 AM
Hi Michael,

Currently, there is no support for hierarchical data. You could try to achieve the desired layout with templates, though - perhaps adding a templated column for the plus/minus sign and handling its click through javascript.

Best wishes,
Alex
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Michael Strasser
Top achievements
Rank 1
answered on 06 Nov 2009, 06:21 PM
Any idea on how to accomplish that?
Thanks!
Mike Strasser
0
Kazi Manzur Rashid
Telerik team
answered on 09 Nov 2009, 09:51 AM
Hello Michael Strasser,

I think we can provide more approprite answer when we are actually going to implmenet it ;-).

Kind regards,
Kazi Manzur Rashid
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Michael Strasser
Top achievements
Rank 1
answered on 18 Dec 2009, 11:03 PM
Do you have any idea on when that would be?
Or, do you have any idea on how I can add the "child" row when the "+" is clicked, etc?

0
Alex Gyoshev
Telerik team
answered on 21 Dec 2009, 09:42 AM
Hello Michael,

I prepared a sample project that demonstrates the concept that I was talking about. We are not sure when the hierarchical binding is going to be implemented, so I hope that this will be useful until then.

P.S. the plus/minus icons are taken from famfamfam, so please give him credit if you intend to use them publicly.

All the best,
Alexander Gyoshev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Michael Strasser
Top achievements
Rank 1
answered on 23 Dec 2009, 10:01 PM
Thanks Alexander, the sample you provided got me past the first hurdle.

My next problem is that the "CustomerDetails" ViewUserControl (mine is named differently) I'm calling has a tab strip that is not rendering properly.  I'm supplying a picture of what it looks like within the MVC grid.  The pic also shows the tabstrip in a standard table.  The tab strip in the standard table looks and works correctly.

Here's the code for the ViewUserControl:

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<%@ Import Namespace="System.Web.Routing" %>
<%
    Guid OrganizationId = (Guid)ViewData["OrganizationId"];

    Html.Telerik().TabStrip()
        .Name("Tab" + OrganizationId.ToString())
        .Items(parent =>
            {
                parent.Add()
                    .Text("Organization Staff")
                    .LoadContentFrom(Url.Action("SummaryUserOrganization", "Organization", new { organizationId = OrganizationId }));
                parent.Add()
                    .Text("Relationships")
                    .LoadContentFrom(Url.Action("SummaryOrganizationRelationships", "Organization", new { organizationId = OrganizationId }));
                parent.Add()
                    .Text("Portal Sites")
                    .LoadContentFrom(Url.Action("SummaryPortalSites", "Organization", new { organizationId = OrganizationId }));
                parent.Add()
                    .Text("Units")
                    .LoadContentFrom(Url.Action("SummaryOrganizationalUnits", "Organization", new { organizationId = OrganizationId }));
                parent.Add()
                    .Text("Staff Pool")
                    .LoadContentFrom(Url.Action("SummaryAllStaff", "Organization", new { organizationId = OrganizationId }));
            }
        )
        .SelectedIndex(0)
        .Render();

%>
Thanks!
Mike
0
Atanas Korchev
Telerik team
answered on 24 Dec 2009, 04:38 PM
Hello Michael Strasser,

Did you register the JavaScript files of the tabstrip? This is mandatory if you load it on demand with Ajax. To do so use the following code:

<%= Html.Telerik().ScriptRegistrar().DefaultGroup(group => group
                               .Add("telerik.common.js").Add("telerik.tabstrip.js"));
%>

Regards,
Atanas Korchev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Michael Strasser
Top achievements
Rank 1
answered on 24 Dec 2009, 06:50 PM
Thanks, that was it!
Tags
Grid
Asked by
Michael Strasser
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Michael Strasser
Top achievements
Rank 1
Kazi Manzur Rashid
Telerik team
Atanas Korchev
Telerik team
Share this question
or