Binding a Gridview to a DetailsView on another page

Discussion in 'ASP .Net Web Controls' started by Coby Herd, Nov 15, 2007.

  1. Coby Herd

    Coby Herd Guest

    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
     
    Coby Herd, Nov 15, 2007
    #1
    1. Advertising

  2. 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

    On Nov 15, 7:04 pm, "Coby Herd" <> wrote:
    > 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-0918www.caterdata.com/portfolio
     
    PJ on Development, Nov 19, 2007
    #2
    1. Advertising

  3. Coby Herd

    radiolandog Guest

    Would this help?

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

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




    "Coby Herd" <> wrote in message
    news:...
    > 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
    >
    >
     
    radiolandog, Nov 26, 2007
    #3
  4. Coby Herd

    Angel Guest

    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


    "Coby Herd" wrote:

    > 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
    >
    >
    >
     
    Angel, Jan 6, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Q2VyaV9EYXZpZXM=?=

    Binding a textbox to a detailsview in asp.net 2.0

    =?Utf-8?B?Q2VyaV9EYXZpZXM=?=, Mar 22, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    1,001
    =?Utf-8?B?Q2VyaV9EYXZpZXM=?=
    Mar 22, 2005
  2. Andrew Robinson

    DetailsView Data Binding

    Andrew Robinson, Sep 30, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    15,151
    Steven Cheng[MSFT]
    Oct 10, 2005
  3. Amit
    Replies:
    6
    Views:
    13,917
    Assimalyst
    Oct 24, 2006
  4. Keith G Hicks
    Replies:
    3
    Views:
    807
    Keith G Hicks
    Feb 18, 2008
  5. Feege
    Replies:
    0
    Views:
    502
    Feege
    Dec 20, 2005
Loading...

Share This Page