属性生成器或者在DataGrid的ItemDataBount事件中写
if(e.Item.ItemType == ListItemType.Header)
{
e.Item.Cells[0].Text = "";
e.Item.Cells[1].Text = "";
...
}
if(e.Item.ItemType == ListItemType.Header)
{
e.Item.Cells[0].Text = "";
e.Item.Cells[1].Text = "";
...
}
解决方案 »
- aspx DataList控件,获取点击行的标题? (重新发帖)[图]
- 关于网站多用户同时登陆操作的混乱问题,怎么解决呢?
- 请问如何保护网站的源码版权问题.
- 求助,调用company.dll 文件时出错了,多谢各位帮忙!1
- 求救,请求版主给予解决方案!此页的视图状态无效,可能已损坏。
- 100分,最先答对的给满分****为什么点击两次上传按钮才能上传
- 急,在线等等。。。。。。。。。。
- ie8传值时中文乱码的问题
- 如何安装html component,扩展名为htc
- ASP.NET的日期控件
- 请问用asp.net做bbs计算机一定要安装MS SQL Server吗?msde不行吗?
- 在asp.net中怎样使用复选框
这名话应该写在哪里??
写在_ItemDataBound()里,出错如下:
引超出范围。必须为非负值并小于集合大小。参数名: index
你的方法可用,能不能对所设的列,设置百分比的宽度??
double[] dbl={10,10,20,10,...};
for (int i=0;i<e.Item.Cells.Count;i++)
{
e.Item.Cells[i].Text = sta.ColChineseName[i]; e.Item.Cells[i].Width = stem.Web.UI.WebControls.Unit.Percentage(dbl[i]);
}
{
if(e.Item.ItemType == ListItemType.Header)
{
for(int i=0;i<e.Item.Cells.Count;i++)
{
e.Item.Cells[i].Text = sta.ColChineseName[i];
e.Item.Cells[i].Width = stem.Web.UI.WebControls.Unit.Percentage(dbl[i]);
}
}
}