gridview, build hyperlinkfield dynamically RRS feed

  • Question

  • 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?

    <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"
    datanavigateurlformatstring="http://....com/Members/files/{id}+/+filename" />
    <asp:BoundField DataField="ID" HeaderText="" SortExpression="ID" InsertVisible="False" Visible="false"
    <ItemStyle BackColor="White" Font-Size="Smaller" ForeColor="White" />

    Many thank for any hints!
    • Moved by Alex-KSGZ Tuesday, March 26, 2019 2:55 AM
    Wednesday, March 20, 2019 9:38 AM

All replies

  • Hi,

     Your issue is more related about asp.net. 

    Ask in the following forum.


    Thank you for your understanding.

    Best Regards,


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, March 21, 2019 1:21 AM