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

Nested Grid Demo : A Question

4 Answers 142 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Aarsh
Top achievements
Rank 1
Aarsh asked on 11 Dec 2012, 02:32 PM
Hi there ! I tried to follow up this (http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/nestedviewtemplatedeclarativerelations/defaultcs.aspx) and also referred this (http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/nestedviewtemplate/defaultcs.aspx) demo and my application it works in a similar way as that demo does. But I have a question for this :

What if I want to have >1 results in the nested grid for records in main grid ?

In terms of Northwind Database (to clarify) assume that I want to enlist customers in the main Grid and their Order History in the nested grid using some stored procedure (could not attach the txt file).

My application shows just one record in the nested (inner) grid at the moment. Is there a way to over-come this ?

Thanks,
-Aarsh


-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Attachment:
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
USE [Northwind]
GO
/****** Object:  StoredProcedure [dbo].[CustOrderHist]    Script Date: 12/11/2012 09:26:46 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[CustOrderHist] @CustomerID nchar(5)
AS
SELECT ProductName, Total=SUM(Quantity)
FROM Products P, [Order Details] OD, Orders O, Customers C
WHERE C.CustomerID = @CustomerID
AND C.CustomerID = O.CustomerID AND O.OrderID = OD.OrderID AND OD.ProductID = P.ProductID
GROUP BY ProductName

4 Answers, 1 is accepted

Sort by
0
Aarsh
Top achievements
Rank 1
answered on 11 Dec 2012, 08:03 PM
I want something like this : (But i do not want to have CRUD operations on it as the demo has, I just want them as readonly)
http://dotnetspeaks.com/LiveDemos/ASP.NET/GridView/EditingNestedGridView.aspx
0
Aarsh
Top achievements
Rank 1
answered on 11 Dec 2012, 08:35 PM
Or It may be as our "Account Overview" Grid, if one can please figure out to bring all those entries from the database. Attached is exactly what I want, provided if we can manage to get the all the entries from the database ( including "Tracked Forums" and "Tracked Issues" )



Of course this is a panel but I want to do the same with Grid, where expanding the main item can display >1 items
0
Aarsh
Top achievements
Rank 1
answered on 12 Dec 2012, 03:58 PM
No-one ?
0
Angel Petrov
Telerik team
answered on 14 Dec 2012, 12:27 PM
Hello Aarsh,

If I understand correctly the requirements, you want to enlist the products that were ordered by a given customer. This can be done using DetailTables and declarative relations. In the SqlDataSource you can define the SelectMethod to match that in the stored procedure. In attachments you can find an example demonstrating this approach. Additionally please take a look at this help article in which declarative relations are thoroughly explained.

All the best,
Angel Petrov
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
Grid
Asked by
Aarsh
Top achievements
Rank 1
Answers by
Aarsh
Top achievements
Rank 1
Angel Petrov
Telerik team
Share this question
or