在软件中 因为要连接到其他的页面所以类型转成了ASPxHyperLink,但是用官方的导出控件导出到excel之后,连接依旧保留着,

目的:去除导出来的连接

方法:把之前的ASPxHyperLink转回成GridViewDataTextColumn,在该列加一个dataitemtemplate

 

1  <dx:GridViewDataTextColumn FieldName="XX" VisibleIndex="0"> 
2   <dataitemtemplate>
3    <dx:ASPxHyperLink ID="Link" runat="server" EnableClientSideAPI="True" Text='<%# Eval("XX")%>'>
4     <clientsideevents click="function(s, e) {
5                                    YourFunction(); 
6                              }" />
7     </dx:ASPxHyperLink>
8  </dataitemtemplate> 
9 </dx:GridViewDataTextColumn>    

 

 

 

这样就可以实现,在程序中显示的是连接形式,且连接依旧可以用,最重要的是导出到excel之后显示的是文本形式的

相关文章:

  • 2022-12-23
  • 2021-09-13
  • 2021-12-12
  • 2021-08-18
  • 2022-12-23
  • 2022-12-23
  • 2021-10-12
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2021-10-16
  • 2022-02-12
  • 2021-11-20
  • 2022-12-23
相关资源
相似解决方案