如何在gridview多列中显示前10个字符 [英] How to display the first 10 characters in a gridview multiple colum

查看:70
本文介绍了如何在gridview多列中显示前10个字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在每个gridview colums中显示前10个字符???

解决方案

有几种方法可以做到这一点。

一个是修改 ItemTemplate TemplateField



 <   asp:templatefield     headertext   = 描述    xmlns:asp   = #unknown >  
< itemtemplate >
< asp:label id = lblDescription runat = < span class =code-keyword> server >
Text ='< %#Limit(Eval( 描述), 10 )%>'
Tooltip ='<% #Eval( 说明)%>'>
< / asp:label >
< / itemtemplate >
< / asp:templatefield >


How to display the first 10 characters in a every gridview colums???

解决方案

There are few ways to do this.
One is by modifying the ItemTemplate in TemplateField

<asp:templatefield headertext="Description" xmlns:asp="#unknown">
 <itemtemplate>
      <asp:label id="lblDescription" runat="server">
                Text='<%# Limit(Eval("Description"),10) %>' 
                Tooltip='<%# Eval("Description") %>'>
      </asp:label>      
 </itemtemplate>
</asp:templatefield>


这篇关于如何在gridview多列中显示前10个字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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