Click here to Skip to main content
15,891,423 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

Is it possible to change the column type of a datagridview to linkcolumn.

Actually i have 3 columns in the dataset which i'm binding to datagridview. I

need the second column to be displayed as link column. I need to achieve this at

run-time. Is it possible??

Regards,

Karthick V
Posted

See here[^].
 
Share this answer
 
v2
There are many of the ways to do that
1. Please check this link[^]
2. This one is also good.[^]

But I preffer to use simple a href in the template field.

Hope this will help you.
 
Share this answer
 
try to find out in the following way

XML
<asp:GridView ID="grdProductList" runat="server" Width="100%" GridLines="None" AllowPaging="True">
 <HeaderStyle HorizontalAlign="Center" />
<Columns>
<asp:TemplateField HeaderText="Special Price">
<ItemStyle Width="20%" HorizontalAlign="center" />
<ItemTemplate>
<asp:HyperLink runat="server" ID="hylnk_SpecialPrice" NavigateUrl='<%# "SpecialPrice.aspx?ProductID=" + Eval("iProductID") %>'
                         Text="Add/Edit"></asp:HyperLink>
 </ItemTemplate>
 </asp:TemplateField>
  </Columns>
</asp:GridView>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900