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

    ..
    <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!
    Wednesday, March 20, 2019 9:38 AM

All replies

  • Hi,

     Your issue is more related about asp.net. 

    Ask in the following forum.

    https://forums.asp.net/

    Thank you for your understanding.

    Best Regards,

    Alex


    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