如何在服务器端改datagrid的一项列名呢? 如题 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 DataGrid1.Columns[i].HeaderText = "ABC"; 帮定的时候也可以改datatable的也可以实现 你的DataGrid如果不是自动生成的列,那么可以用这个方法。DataGrid1.Columns[i].HeaderText = "ABC";并且一定要在DataGrid绑定前运行。如果你的DataGrid是自动生成列的,那么Select语句来控制是比较方便的,如:select customer as [abc i need] from tablename where condition=''; skytear(铁匠) 回答非常全面了,偶就不重复了 我这个看样没法加了//ItemDataBound事件 string up=Convert.ToString(DataBinder.Eval(e.Item.DataItem,"字段名")); if(up.Length>3) { up=up.Substring(0,3)+"..."; } e.Item.Cells[6].Text=up; e.Item.Cells[6].ToolTip=up; 也可以在ItemDataBound事件中调整:if(e.Item.ItemType == ListItemType.Header){........ e.Item.Cells[6].Text=up;} 怎么给asp:Image的ImageUrl的属性赋值 如何用vs2010调试虚拟主机上的asp.net程序 【问】ASP.NET中是否应当尽量将所有的T-SQL写成存储过程? 创建SQL的语句 多人合作开发net项目 请教.net文件的显示 关于万能报表打印问题 问一个很简单的一个问题 HTML的file控件问题 求一个asp.net论坛程序~~ 要求很好的支持中文~ ::偶正要做一个艺术品展览的网站,各位能提供网站参考参考吗? 现在在Javascript中有两个方法function1,function2,我想循环调用这两个方法,如何办呀??
DataGrid1.Columns[i].HeaderText = "ABC";
并且一定要在DataGrid绑定前运行。如果你的DataGrid是自动生成列的,那么Select语句来控制是比较方便的,如:
select customer as [abc i need] from tablename where condition='';
//ItemDataBound事件
string up=Convert.ToString(DataBinder.Eval(e.Item.DataItem,"字段名"));
if(up.Length>3)
{
up=up.Substring(0,3)+"...";
}
e.Item.Cells[6].Text=up;
e.Item.Cells[6].ToolTip=up;
if(e.Item.ItemType == ListItemType.Header)
{
........
e.Item.Cells[6].Text=up;}