DataGrid的格式控制问题? string sqlc="select id,convert(char(5),title)+'......' as title from doc where id=@id"; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用模板列。<ItemTemplate><%# NeedShow(DataBinder.Eval(Container.DataItem,"字段").ToString()) %></ItemTemplate>在后台中定义方法:public string NeedShow(string k){ k = k.SubString(0,4); k = k + "...."; return k;} 你可以这样呀!比如:DataGrid.DataBind()之后你用for(int i=0;i<DataGrid1.Items.Count;i++) { string a=e.Item[i].Cell[0].Text if (a.Length>10) a=a.SubString(0,4); } 你可以这样呀!比如:DataGrid.DataBind()之后你用for(int i=0;i<DataGrid1.Items.Count;i++) { string a= if (e.Item[i].Cell[0].Text.Length>10) e.Item[i].Cell[0].Text=e.Item[i].Cell[0].Text.SubString(0,4); } 关于VS2010里使用AjaxPro.dll的问题,请高手帮下忙 用asp.net制作类似百度文库的代码 如何让不同的.asmx请求链接都由同一个webservice处理? 如何在aspx页面将repeater绑定的值临时给一个变量 请各位高手怎么样把自己做好的网站上传到网上??? 起始页面加载数据量太大的问题怎么解决? 请教:如何取得刚刚添加的一条数据的id? 可本地连接直接写IP地址为什么就错误? ▲▲▲aspx前台页面怎样使用Session MVC路由配置 字符替换VB转C#的问题 在C#中,如何处理日期相减,并得到天数(long)?
<ItemTemplate>
<%# NeedShow(DataBinder.Eval(Container.DataItem,"字段").ToString()) %>
</ItemTemplate>在后台中定义方法:public string NeedShow(string k)
{
k = k.SubString(0,4);
k = k + "....";
return k;
}
比如:DataGrid.DataBind()之后
你用
for(int i=0;i<DataGrid1.Items.Count;i++)
{
string a=e.Item[i].Cell[0].Text
if (a.Length>10)
a=a.SubString(0,4); }
比如:DataGrid.DataBind()之后
你用
for(int i=0;i<DataGrid1.Items.Count;i++)
{
string a=
if (e.Item[i].Cell[0].Text.Length>10)
e.Item[i].Cell[0].Text=e.Item[i].Cell[0].Text.SubString(0,4);
}