Hi Nalaka,
As for your question on displaying Nested GridView which has relation ships
between the binding datas. I think you can consider the following means:
We can put an invisible label or TextBox control in the templateField where
we'll also put the Nested GridView and sub DataSource control. Then, the
invisible Label or TextBox's Text property will be binded to parent
GridView's Key Column value(we can do this through IDEs' wizard ---- Edit
Template.....). After that, we configure the Sub DataSource control in the
template field, and add a control parameter for its "Where ...." sql
statement, and specify the invisible Label or Textbox as the control
source. Then, bind the nested GridView to the sub DataSource and run the
page, that'll display the nested GridViews we expected.
Actually I've tested with the NorthWind's Orders and OrderDetails tables
and works well.(I've even tested three level nested and also works
).
However, one important things we need to take care, such template databound
control(GridView, DataList....) all store the binded datas in ViewState
which may make the page's size extremely huge. You'd take care of this to
see whether it's appropriate according to the target environment's network
bandwidth.
If there're anything unclear, please feel free to post here. Thanks,
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: "Nalaka" <
[email protected]>
| Subject: GridView in a GridView
| Date: Thu, 10 Nov 2005 16:07:27 -0800
| Lines: 17
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| Message-ID: <
[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: m181-9.bctransit.bc.ca 199.60.181.9
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:357227
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Hi,
| I have a gridView (grid1), which as a templateColumn.
| In the template column, I have put in a gridView (grid2) and a
| ObjectDataSource (objectDataSource2).
|
| Question is... How to I pass the current_row_key of Grid1... to the
| objectDataSource2 parameter?
| (so that the second grid, gets only the information to do with current
row
| of grid1)
|
|
| any help is deeply appreciated...
|
| Thanks
| Nalaka
|
|
|