GridView绑定下拉菜单 GridView中一的项默认显示是一个数值,当我点后面的修改的时候, 原来显示的那项变成下拉菜单这种功能如何实现 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用模板列,itemtemplate里放一个label,即默认时显示方式;edititemtemplate里放dropdownlist,即点修改后的显示方式 前台如楼上所说,设定一个模板列,在<ItemTemplate>里放一个Label,做为默认显示方式;在<EditItemTemplate>里放一个DropDownList,做为点击修改后显示方式。。后台的话:在Row_DataBound事件里: protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (((DropDownList)e.Row.FindControl("DDLAddress")) != null) { DropDownList ddlAddress = (DropDownList)e.Row.FindControl("DDLAddress"); DataSet ds = Common.dataSet("select Address from Address"); ddlAddress.DataSource = ds.Tables[0].DefaultView; ddlAddress.DataTextField = "Address"; ddlAddress.DataValueField = "Address"; ddlAddress.DataBind(); } } 全部都不行,就是取不到<EditItemTemplate>中的东西 谁对NPOI操作Excel比较熟的请进来看看 为什么ajax在页面中不作响应了 C# 专业问题 昨天我看了一个“Asp.net简单饼图XML投票系统源码”我出现了一个疑问 gridview怎么行转列 想做一个网上的QQ即时的点对点发送短信的 请大家指点 关于数字验证问题 请问 如何使鼠标移到treeview上时显示提示? TreeView的问题,求助!!!写得很详细了~~~ 怎么遍历datagride 天哪,又是同样的问题 C# .NET WinForm 控件 DataGridView 列 DataGridViewComboBox[问题点数:300分]
在<EditItemTemplate>里放一个DropDownList,做为点击修改后显示方式。。后台的话:
在Row_DataBound事件里: protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (((DropDownList)e.Row.FindControl("DDLAddress")) != null)
{
DropDownList ddlAddress = (DropDownList)e.Row.FindControl("DDLAddress");
DataSet ds = Common.dataSet("select Address from Address");
ddlAddress.DataSource = ds.Tables[0].DefaultView;
ddlAddress.DataTextField = "Address";
ddlAddress.DataValueField = "Address";
ddlAddress.DataBind();
}
}