<ASP:DataGrid id="MyDataGrid" runat="server"
OnItemCreated="MyDataGrid_ItemCreated"
..... void MyDataGrid_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Pager)
{
Label c = new Label();
c.ID = "hello";
c.Text = "hello world";
e.Item.Cells[0].Controls.Add(c);
}
}
OnItemCreated="MyDataGrid_ItemCreated"
..... void MyDataGrid_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Pager)
{
Label c = new Label();
c.ID = "hello";
c.Text = "hello world";
e.Item.Cells[0].Controls.Add(c);
}
}
解决方案 »
- 帮我看看我的正则写对了吗..谢谢!
- |zyciis| 枚举好何进行.ToString 重写, 谢谢
- Google地图标记问题
- 微软的网址中顶部banner的冻结怎么做的
- 在ASP。NET中怎样实现Winsocket??
- 动态生成的控件使用问题
- 请教大家一个问题,有谁做过POS机程序的开发吗,你们一般报价都是多少?
- 100分了,这个功能如何实现:当用户输入一个路径,如果路径不存在提示用户是否创建啊
- 还是treeview,再弄下去偶就要吊死在这棵树上了:( 我要完整的代码!江雨/csharpboy/lveight 帮忙!!!
- 如何把数据库里的记录读出显示,并在此页面上可以更改此记录,再写回数据库中?--急!!!帮MM解决问题者奖赏优厚!
- asp.net中如何调用office工具条空控件?
- 求.NET Web圖表控件,畫折線圖
{
Label c = new Label();
c.ID = "hello";
c.Text = "hello world";
e.Item.Cells[3].Controls.Add(c);
}
}出错Cell只能是Cell[0], 别的都不行, 这是怎么回事啊 ,
-------------------------------
private void DataGrid1_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{if (e.Item.ItemIndex >= 0)
{
intArg += int.Parse(e.Item.Cells[1].Text); //假设处理第一列
}if (e.Item.ItemType == ListItemType.Footer)
{
e.Item.Cells[1].Text = intArg.ToString();
}