Adding a href link to a column in a data grid

Discussion in 'ASP .Net Datagrid Control' started by Vasantha peddireddy, Aug 23, 2005.

  1. Hi,

    I am trying to figure out how I can add a html link to a value (which is the
    virtual path of a file) in the data grid column. I have code as below. Please
    help!

    <asp:DataGrid id="DataGrid1" BorderColor="black" BorderWidth="1"
    CellPadding="3" AutoGenerateColumns="false"
    runat="server" AllowPaging="True" ItemStyle-Wrap=true>
    <HeaderStyle BackColor="#00AAAA"></HeaderStyle>
    <Columns>
    <asp:BoundColumn DataField="VPath"
    HeaderText="VPath"></asp:BoundColumn>
    </column>
    </asp:Datagrid>
     
    Vasantha peddireddy, Aug 23, 2005
    #1
    1. Advertising

  2. Vasantha peddireddy

    Elton Wang Guest

    Try HyperLinkColumn:

    <asp:HyperLinkColumn DataTextField="VPath" HeaderText="Link"
    DataNavigateUrlField="VPath"
    DataNavigateUrlFormatString="page.aspx?path={0}">
    </asp:HyperLinkColumn>


    "Vasantha peddireddy" <> wrote
    in message news:...
    > Hi,
    >
    > I am trying to figure out how I can add a html link to a value (which is

    the
    > virtual path of a file) in the data grid column. I have code as below.

    Please
    > help!
    >
    > <asp:DataGrid id="DataGrid1" BorderColor="black" BorderWidth="1"
    > CellPadding="3" AutoGenerateColumns="false"
    > runat="server" AllowPaging="True" ItemStyle-Wrap=true>
    > <HeaderStyle BackColor="#00AAAA"></HeaderStyle>
    > <Columns>
    > <asp:BoundColumn DataField="VPath"
    > HeaderText="VPath"></asp:BoundColumn>
    > </column>
    > </asp:Datagrid>
     
    Elton Wang, Aug 23, 2005
    #2
    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. Vikramaditya Singh

    adding serial no column in a bounded data grid

    Vikramaditya Singh, Jan 28, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    3,506
    Saravana [MVP]
    Jan 28, 2004
  2. CRON
    Replies:
    24
    Views:
    201,696
    Adrienne Boswell
    Jun 20, 2006
  3. Jeff
    Replies:
    0
    Views:
    416
  4. Soren Vejrum
    Replies:
    4
    Views:
    667
    Lasse Reichstein Nielsen
    Jul 5, 2003
  5. saiho.yuen
    Replies:
    3
    Views:
    455
    kaeli
    Sep 14, 2004
Loading...

Share This Page