将datagridview的列类型更改为linkcolumn. [英] change the column type of a datagridview to linkcolumn.

查看:81
本文介绍了将datagridview的列类型更改为linkcolumn.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



是否可以将datagridview的列类型更改为linkcolumn.

实际上我在数据集中有3列绑定到datagridview.我

需要将第二列显示为链接列.我需要在
实现
运行.有可能吗?

问候,

Karthick V

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

推荐答案

请参阅

有很多方法可以做到这一点
1.
请检查此链接 [这也很好. [
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.


尝试通过以下方式找出

try to find out in the following way

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


这篇关于将datagridview的列类型更改为linkcolumn.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆