bull1998
June 11th, 2002, 10:58 AM
Is there a way to make a column in DataGrid or Datalist a hyperlink? I tried <asp:HyperLink> and <a href="somelink"> but none of them worked. they always display the contents as plain text.
Thanks in advance.
Ai3xSKC
June 14th, 2002, 10:42 AM
Hi,
you have to create a <asp:templatecolumn>...
here's an example
<asp:datagrid runat="server" id="table1">
<asp:templatecolumn runat="server" id="template1">
<itemtemplate>
<asp:hyperlink runat="server" id="link1">Click Me</asp:hyperlink>
</itemtemplate>
<asp:templatecolumn>
</asp:datagrid>
you could use any asp tags in there like checkbox, linkbutton....
but remember that in order to access their properties, you have to do a FindControl on the hyperlink ID....
Steve