I have grid that has a list of about 16 documents that can change depending on the person using the app. I’ve been asked to change three specific entries in the grid if they exist to links that open the documents.
How do I check for these three documents in the grid (column is called “Artifact”) and insert the correct link for each of the three documents instead of the default text?
<asp:BoundField HeaderText="Artifact" DataField="ArtifactName" Visible="true" HeaderStyle-Width="300px" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
The same links are available in other parts of our website. Here is how they are implemented on other pages
<asp:LinkButton
ID="hypLnkAffidRelease2"
runat="server"
Text="Affidavit and Release form"
/>
var url = ResolveUrl("~/FormViewer.aspx");
this.lnkDownloadReleasefrm.Attributes.Add("onclick", " { popup=window.open('" + url + "?Form=4','Viewer','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width=800, height=600'); popup.focus(); return false; }");
You can create TemplateField with two ItemTemplate (Label & HyperLink)
Label is more or less like BoundField once rendered.
When you bind the gridview