Archive for the '.Net' Category
Setting the NavigateUrl property of a hyperlink control in gridview is very easy. But what if you want to pass the value of a specific field in your gridview as a url parameter of your hyperlink control? Well here’s how to do it.
Let say we have a customer list in a gridview and an edit [...]
Problem: I customized my gridview and created a set of boundfield columns. Now, I need to make one of these boundfields be clickable or some sort of hyperlink.
Solution: Create a TemplateField and a hyperlink control in your ItemTemplate.
<asp:GridView ID="GridView1" runat="server">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="Hyperlink1" runat="server"
Text='<%# Bind("FieldName") %>'>
</asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
In this example, the HyperLink Text property is binded to a specific [...]


