RE: VS2005 DataList with Nested GridView using ObjectDataSource



Hello Sam,

Welcome to ASPNET newsgroup.
>From your description, you're wantting to display some data on the ASP.NET
2.0 web page through the DataList control, and since those data records can
be grouped by some certain category field, you'd like to display the main
category items in the DataList and in each DataList item , use a GridView
to display those sub detailed items belong to each category value(just like
the Category/Product.... table in NorthWind...), yes? If anything I didn't
get correctly, please feel free to let me know.

Based on my understanding, the current ASP.NET 2.0 DataSource
control/DataBound control's relationship model require that the DataSource
control directly provide the records be bound to databound control, then we
declare some bound fields...
For nested databound (GridView nested in GridView or GridView nested in
DataList.....), if we still want to use declarative bound with out code, we
have to put another nested DataSource control in the primary (toplevel)
databound control's ItemTemplate... And the nested DataBound control can
be associated to that nested datasource control.........

For your scenario, if you want to reuse the Data collection return from the
webservice, and don't want additional data retrieving in each
ItemTemplate's databinding, I'm afraid we have to manually use code to fill
out different datasource from the Main datasource (retrieved from
webservice....). e.g, the webservice return a DataTable, we first
programmatically select all the distinct categories from it and bind the
categories collection with DataList, and in each ItemTemplate, we use the
category id to querty that dataset again to retrieve the products belong to
that category. Just what we also need to do in ASP.NET 1.X ...

How do you thinks of this? If you have any other ideas or question, please
feel free to post here.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Sam Loveridge" <sloveridge@xxxxxxxxxxxxxxxxxxx>
| Subject: VS2005 DataList with Nested GridView using ObjectDataSource
| Date: Wed, 30 Nov 2005 16:08:18 +1030
| Lines: 31
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| Message-ID: <eBDuJBX9FHA.472@xxxxxxxxxxxxxxxxxxxx>
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| NNTP-Posting-Host: 203.33.102.104
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP15.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:31391
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
|
| Hi All.
|
| I have been loving the easy binding of a straight forward GridView
directly
| to a web service method using the ObjectDataSource, however I've come
into a
| tangle trying to apply a more complex binding solution with a DataList.
|
| Let's say the simple method described above is a full list of items with
a
| customer number in a grid (call it QUERY A). What I want to do is use the
| same data source for QUERY A to display a DataList that groups items by
| customer details.
|
| What I have established is a DataList that binds to a customer query to
| display more detailed customer information as the primary data source for
| the DataList (QUERY B), but within its ItemTemplate I want to display a
| GridView for each customer to display their items. Ideally this sub query
| should be based on the data from QUERY A so I don't have to load it all
| again, making the switching between the full list and the grouped by
| customer views faster.
|
| This sounds like your classic master/slave query, where the data source
for
| the nested GridView in the DataList is driven from a value in the
DataList
| control for the customer ID, but how do I create a data source for my
QUERY
| A data to allow the funky VS2005 binding with minimal code-behind?
|
| Any ideas?
|
| Thanks in advance,
|
| Sam.
|
|
|

.



Relevant Pages

  • Re: How to populate a list box based on user input?
    ... that makes perfect sense to build a query that gets info from all the ... We are talking several minutes to retrieve and display the ... Control Source to an expression that calls one of the domain aggregate ... to put the SQL in the Row Source. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Cascading combo boxes and updating second box
    ... I needed to invoke a query on the form so that a field in the ... Set its Control Source to the value you want displayed, ... The textbox will display the "looked up" value, ... behind the dropdown when the user opens the combo. ...
    (microsoft.public.access.forms)
  • Problems in Access (error 2185) creating custom form to build dynamic query.
    ... The form should build a query that can be stored or used to view the ... pure VB6 form connected to an Access 2000 MDB database. ... When I click the command button to display the query with just one parameter ... control has the focus". ...
    (microsoft.public.access.formscoding)
  • Re: Subform Recordsource changes
    ... I've come to the same conclusion but have decided that the TreeView control ... is probably the better way to display the hierarchial data set. ... > You could make it a bit easier by having the subform be a datasheet view ... > assign the control source for each column based on which query was selected ...
    (microsoft.public.access.forms)
  • Re: DataGrid will not display
    ... data connection and having it display in a browser. ... the gtid will not display on my page. ... what happene3d to the datagrid control in the ... think you should bind your gridview with dataset that is objDS and it ...
    (microsoft.public.dotnet.framework.adonet)

Loading