Adding a href link to a column in a data grid

  • Thread starter Vasantha peddireddy
  • Start date
V

Vasantha peddireddy

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>
 
E

Elton Wang

Try HyperLinkColumn:

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

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top