gridview, build hyperlinkfield dynamically

  • Thread starter Thread starter metallon123
  • Start date Start date
M

metallon123

Guest
Dear .net Experts,

I have build my gridview and it shows fine but now I need a custom link that enables
the user to view the file. For that I need to build the link dynamically using
the other gridview column content in the link path.

datanavigateurlformatstring="http://....com/Members/files/{id}+/+{filename}" />

How can I do this?


..
<Columns>
<asp:CommandField ShowDeleteButton="True" DeleteText="Delete this" />
<asp:BoundField DataField="Filename" HeaderText="File" SortExpression="Filename" />
<asp:BoundField DataField="Comment" HeaderText="Comment" SortExpression="Comment" />

<asp:hyperlinkfield headertext="View"
datatextfield="View"
datanavigateurlformatstring="http://....com/Members/files/{id}+/+filename" />

<asp:BoundField DataField="ID" HeaderText="" SortExpression="ID" InsertVisible="False" Visible="false"
ReadOnly="True">
<ItemStyle BackColor="White" Font-Size="Smaller" ForeColor="White" />
</asp:BoundField>
</Columns>

Many thank for any hints!

Continue reading...
 
Back
Top