HyperLinkColumn in a DataGrid

Discussion in 'ASP .Net' started by =?Utf-8?B?Z2xlbm4=?=, Jun 13, 2006.

  1. Hello,

    I have a HyperLinkColumn in a DataGrid found in a Summary page.

    When the link is clicked on, I want to get the data for all fields in the
    database for that record and display this data on a Details page that does
    not display the data in a DataGrid but instead displays it in a series of
    databound label controls.

    Is this possible or do I need to display the data on my Details page in a
    DataGrid?

    Thanks for any pointers.

    -glenn
     
    =?Utf-8?B?Z2xlbm4=?=, Jun 13, 2006
    #1
    1. Advertising

  2. =?Utf-8?B?Z2xlbm4=?=

    Jason Coyne Guest

    This is very possible. You need to provide the ID for each row to the
    hyperlink. You can do this in the onItemDataBound event of your
    datagrid, using the FindControl() function to get the link for each
    row, and then add a querystring parameter to the link. You could also
    do this in the HTML view, by modifying the DataBinder.Eval syntax.

    Then on your destinatino page, just grab the querystring parameter, and
    display whatever data you want.

    the alternative would be to use something like a LinkButton, and then
    either redirect as above, or also you could stay on the same page, but
    hide the datagrid and show your labels.


    glenn wrote:
    > Hello,
    >
    > I have a HyperLinkColumn in a DataGrid found in a Summary page.
    >
    > When the link is clicked on, I want to get the data for all fields in the
    > database for that record and display this data on a Details page that does
    > not display the data in a DataGrid but instead displays it in a series of
    > databound label controls.
    >
    > Is this possible or do I need to display the data on my Details page in a
    > DataGrid?
    >
    > Thanks for any pointers.
    >
    > -glenn
     
    Jason Coyne, Jun 13, 2006
    #2
    1. Advertising

  3. Jason,

    Could you point me to any sample code that might illustrate how to do what
    you have described?

    -Glenn

    "Jason Coyne" wrote:

    > This is very possible. You need to provide the ID for each row to the
    > hyperlink. You can do this in the onItemDataBound event of your
    > datagrid, using the FindControl() function to get the link for each
    > row, and then add a querystring parameter to the link. You could also
    > do this in the HTML view, by modifying the DataBinder.Eval syntax.
    >
    > Then on your destinatino page, just grab the querystring parameter, and
    > display whatever data you want.
    >
    > the alternative would be to use something like a LinkButton, and then
    > either redirect as above, or also you could stay on the same page, but
    > hide the datagrid and show your labels.
    >
    >
    > glenn wrote:
    > > Hello,
    > >
    > > I have a HyperLinkColumn in a DataGrid found in a Summary page.
    > >
    > > When the link is clicked on, I want to get the data for all fields in the
    > > database for that record and display this data on a Details page that does
    > > not display the data in a DataGrid but instead displays it in a series of
    > > databound label controls.
    > >
    > > Is this possible or do I need to display the data on my Details page in a
    > > DataGrid?
    > >
    > > Thanks for any pointers.
    > >
    > > -glenn

    >
    >
     
    =?Utf-8?B?Z2xlbm4=?=, Jun 13, 2006
    #3
    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. vtreddy
    Replies:
    0
    Views:
    2,068
    vtreddy
    Nov 6, 2003
  2. =?Utf-8?B?RGF2ZQ==?=

    Can't apply CSS class to DataGrid's HyperlinkColumn?

    =?Utf-8?B?RGF2ZQ==?=, Feb 27, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    2,071
    Martin Dechev
    Feb 27, 2004
  3. Rob Meade

    Datagrid - HyperLinkColumn

    Rob Meade, Aug 9, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    585
    Rob Meade
    Aug 9, 2004
  4. Replies:
    2
    Views:
    3,461
  5. =?Utf-8?B?TmFk?=

    DataGrid's Hyperlinkcolumn vs LinkbuttonColumn

    =?Utf-8?B?TmFk?=, Jun 30, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    676
    Joe Fallon
    Jul 3, 2005
Loading...

Share This Page