有关于datagrid模板页脚的用法 DataGrid的模板的页脚里放了一个dropdownlist控件,作用是快速添加新行,在程序运行时在页脚绑定dropdownlist控件 现在我在page_load事件里找不到dropdownlist控件的ID, dropdownlist控件梆定不了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 private void Links_ItemCommand(object source, DataListCommandEventArgs e) { if(e.Item.ItemType==ListItemType.Footer) { ForumLink link = new ForumLink(); link.Name = ((TextBox)e.Item.FindControl("NewLinkName")).Text.Trim(); link.NavigateUrl = ((TextBox)e.Item.FindControl("NewLinkUrl")).Text.Trim(); if(link.Name == String.Empty || link.NavigateUrl == String.Empty)return; ForumLinks.InsertForumLink(link); Links.EditItemIndex=((ArrayList)Links.DataSource).Count; Links.DataBind(); } }这样就可以 ((DataList)DLjz.Items[i].FindControl("DLmore1")).DataSource = DBUtility.QueryByAdapter(sqlstr);前面的DataList是内藏的控件的类型,后面的DLmore1是控件的ID DataGrid的ItemBound中if(e.Item.ItemType==ListItemType.Footer){ string sql = "... "; OleDbDataAdapter objAdapter = new OleDbDataAdapter(sql,Conn); DataSet objDataSet = new DataSet(); objAdapter.Fill(objDataSet,"product"); DropDownList tempobj=(DropDownList)e.Item.FindControl("Dropdownlist"); tempobj.DataSource=objDataSet.Tables["product"]; tempobj.DataTextField=objDataSet.Tables["product"].Columns["name"].ToString(); tempobj.DataValueField=objDataSet.Tables["product"].Columns["id"].ToString(); tempobj.DataBind();} 你这个问题还问了两遍啊http://community.csdn.net/Expert/topic/3491/3491714.xml?temp=.7456324 求输入文本框中数字的和(不包括非数字),得到的结果再求和,以此类推,求得个位数 自定义表单提交 多服务器网站 网站迁移服务器问题 新闻内容页面分页问题!!!! GridView 邦定的数据源中没有唯一标示符怎么办 有关版本控制的问题 请问如何打包,制作安装部署 +++++++++++关于上传图片失真的问题,请高手拔刀相助!!!++++++++++ ip地址的隐藏 急 如何动态生成控件? 如何建立一个网站? 为什么这两句程序没有做用呀??ds2.Tables [0].Rows [i].Delete ();ds2.AcceptChanges ();怎么删除DS中的ROW呀??
if(e.Item.ItemType==ListItemType.Footer) {
ForumLink link = new ForumLink();
link.Name = ((TextBox)e.Item.FindControl("NewLinkName")).Text.Trim();
link.NavigateUrl = ((TextBox)e.Item.FindControl("NewLinkUrl")).Text.Trim();
if(link.Name == String.Empty || link.NavigateUrl == String.Empty)return;
ForumLinks.InsertForumLink(link);
Links.EditItemIndex=((ArrayList)Links.DataSource).Count;
Links.DataBind();
}
}这样就可以
if(e.Item.ItemType==ListItemType.Footer)
{
string sql = "... ";
OleDbDataAdapter objAdapter = new OleDbDataAdapter(sql,Conn);
DataSet objDataSet = new DataSet();
objAdapter.Fill(objDataSet,"product");
DropDownList tempobj=(DropDownList)e.Item.FindControl("Dropdownlist");
tempobj.DataSource=objDataSet.Tables["product"];
tempobj.DataTextField=objDataSet.Tables["product"].Columns["name"].ToString();
tempobj.DataValueField=objDataSet.Tables["product"].Columns["id"].ToString();
tempobj.DataBind();
}
http://community.csdn.net/Expert/topic/3491/3491714.xml?temp=.7456324