hyper link in DataGrid

Discussion in 'ASP .Net Web Controls' started by Alexander Kaplunov, Dec 17, 2003.

  1. I have a DataGrid, which gets populated by DataSet.

    DataGrid1.DataSource=ds;
    DataGrid1.DataBind();

    What I need to do is when the DataGrid is populated each item in first
    column should be a link (or something clickable). I need to be able to know
    when user has clicked on a particular item and then I can take some action.

    Maybe I shouldn't use DataGrid? Any help would be appreciated.

    Thank you,
    Alex.
    Alexander Kaplunov, Dec 17, 2003
    #1
    1. Advertising

  2. Hi,

    Here is the sample.

    <asp:DataGrid runat="server" id="DataGridID"
    AutoGenerateColumns="False"
    ...>

    <Columns>
    ...
    <asp:HyperLinkColumn Text="Hyperlink Text"
    DataNavigateUrlField="SomeDataSourceField"
    DataNavigateUrlFormatString="/details.aspx?ID=
    {0}"
    Target="_blank" />
    ...
    </Columns>
    </asp:DataGrid>

    on the ItemDataBound column you can raise ur method.


    Regards
    Mahesh ChandraMouli
    Microsoft .NET MVP|MCAD (Charter Member)


    >-----Original Message-----
    >I have a DataGrid, which gets populated by DataSet.
    >
    >DataGrid1.DataSource=ds;
    >DataGrid1.DataBind();
    >
    >What I need to do is when the DataGrid is populated each

    item in first
    >column should be a link (or something clickable). I need

    to be able to know
    >when user has clicked on a particular item and then I

    can take some action.
    >
    >Maybe I shouldn't use DataGrid? Any help would be

    appreciated.
    >
    >Thank you,
    >Alex.
    >
    >
    >.
    >
    Mahesh ChandraMouli[MVP], Dec 18, 2003
    #2
    1. Advertising

  3. Alexander Kaplunov

    James Radke Guest

    Alex,

    What kind of action do you want to take when the link is clicked?

    Jim

    "Alexander Kaplunov" <> wrote in message
    news:...
    > I have a DataGrid, which gets populated by DataSet.
    >
    > DataGrid1.DataSource=ds;
    > DataGrid1.DataBind();
    >
    > What I need to do is when the DataGrid is populated each item in first
    > column should be a link (or something clickable). I need to be able to

    know
    > when user has clicked on a particular item and then I can take some

    action.
    >
    > Maybe I shouldn't use DataGrid? Any help would be appreciated.
    >
    > Thank you,
    > Alex.
    >
    >
    James Radke, Dec 18, 2003
    #3
  4. Make a DB call and repopulate the DataGrid with new stuff returned from DB.


    "James Radke" <> wrote in message
    news:...
    > Alex,
    >
    > What kind of action do you want to take when the link is clicked?
    >
    > Jim
    >
    > "Alexander Kaplunov" <> wrote in message
    > news:...
    > > I have a DataGrid, which gets populated by DataSet.
    > >
    > > DataGrid1.DataSource=ds;
    > > DataGrid1.DataBind();
    > >
    > > What I need to do is when the DataGrid is populated each item in first
    > > column should be a link (or something clickable). I need to be able to

    > know
    > > when user has clicked on a particular item and then I can take some

    > action.
    > >
    > > Maybe I shouldn't use DataGrid? Any help would be appreciated.
    > >
    > > Thank you,
    > > Alex.
    > >
    > >

    >
    >
    Alexander Kaplunov, Dec 18, 2003
    #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. Meheraj shaik via .NET 247

    Hyper link in Datagrid

    Meheraj shaik via .NET 247, May 28, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    2,502
  2. k-re
    Replies:
    1
    Views:
    1,722
    Tim S.
    Jun 25, 2003
  3. Hyper Link in DataGrid

    , Mar 3, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    487
    Patrick.O.Ige
    Mar 3, 2006
  4. Yann.K
    Replies:
    9
    Views:
    338
    Nemesis
    Sep 8, 2004
  5. Jonathan  Ellis

    Re: open default MUA with a hyper link

    Jonathan Ellis, Sep 3, 2004, in forum: Python
    Replies:
    2
    Views:
    307
    Thierry S.
    Sep 6, 2004
Loading...

Share This Page