更新时间:2023-10-04 16:07:52
我找到的解决方案是这样使用 asp:TemplateField ,同时不失去排序能力并使用 Eval 使用数据文本字段:
The solution I found was using asp:TemplateField this way, without losing the Sorting ability and using the datatextfield using Eval:
<asp:TemplateField HeaderText="Name" SortExpression="PartnerName">
<ItemTemplate>
<a onclick="javascript:alert('ok')" href="http://<%#Eval("PartnerName")%>"><%#Eval("PartnerName")%></a>
</ItemTemplate></asp:TemplateField>