all groups > asp.net webcontrols > november 2007 >
You're in the

asp.net webcontrols

group:

Binding a Gridview to a DetailsView on another page


Binding a Gridview to a DetailsView on another page Coby Herd
11/15/2007 4:04:27 PM
asp.net webcontrols: I'm having trouble finding out how to bind a gridview containing data to
individual details on another page. Can anybody send me the code or point
me in the right direction to get a tutorial for this?

thanx


--
Coby L. Herd
112-A S.E. 13th Ave.
Ft. Lauderdale, FL. 33301
954-467-0918
www.caterdata.com/portfolio

Re: Binding a Gridview to a DetailsView on another page PJ on Development
11/19/2007 4:49:06 AM
Hi, Coby

What do you mean by "binding"?

Because when I hear "bind" I usually think about Data Binding, which
is not possible.

However, if you're refereing to displaying the details on another
page, I think that the best way to do this is pass the ID< or Code, or
whatever, to the page via QueryString.

Regards,

Paulo Santos
http://pjondevelopment.50webs.com

[quoted text, click to view]
Re: Binding a Gridview to a DetailsView on another page radiolandog
11/26/2007 12:51:06 PM
Would this help?

http://msdn2.microsoft.com/en-us/library/aa581796.aspx

Have you tried goggling "asp.net master detail?"




[quoted text, click to view]

RE: Binding a Gridview to a DetailsView on another page Angel
1/6/2008 4:50:01 AM
I guess by now you have your answer... But another approach

Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.GridViewCommandEventArgs) Handles
GridView1.RowCommand
If e.CommandName.Equals("Select") Then
Dim RowIndex As Integer =
Convert.ToInt16(e.CommandArgument.ToString)
ViewState("PrimaryKey") =
GridView1.DataKeys(RowIndex).Value.ToString
BindDetailsView(ListItemType.Item)
End If
End Sub

You do need to set the gridview DataKeyNames with key field.

the wacky BindDetailsView(ListItemType.Item) is because the snippet
comes from a real working example where I dynamically set all the
properperies. I make no use of declarative stuff.

Hope it helps


--
aaa


[quoted text, click to view]
AddThis Social Bookmark Button