string str = ((DropDownList)(e.Item.Cells[i].FindControl("关键字"))).SelectedItem.Text;
解决方案 »
- 小小菜鸟潜水一年, 请教几个初级问题
- 求解决思路
- 如何加强可视化设计?
- 如何使用Itext 隐藏 ToolBar(或隐藏保存按钮) ,保留打印按钮?
- asp.net treeview展开时TreeNodeExpanded事件中怎么判断展开的node是哪一个?
- 如何防止组合查询的组合爆炸问题?
- 怎样才能让网页内容不存到客户机的IE临时文件夹里????
- 水晶报表中的切换字段视图按钮~~~
- 十万火急!没装office xp时,vs.net运行正常;装了office xp后,vs.net就自动退出了。
- 在线考试页面提交时不走button_click函数,出现的提示是刷新页面才会有的
- js如何获取GridView模板列的值
- SOS,有人用过ultraweblistbar吗?
protected void GridSqlDataSource_Updating(object sender, SqlDataSourceCommandEventArgs e)
{
this.GridSqlDataSource.UpdateParameters["publishid"].DefaultValue = ((DropDownList)this.GridView1.Rows[this.GridView1.EditIndex].FindControl("editIssueDropDownList")).SelectedValue;
this.GridSqlDataSource.UpdateParameters["filename"].DefaultValue = ((FileUpload)this.GridView1.Rows[this.GridView1.EditIndex].FindControl("FileUpload2")).FileName;
this.GridSqlDataSource.Update();
}
但更新到数据库后是空值。这是为什么?
{
string a = dt.Rows[0]["status"].ToString();
DropDownList L1 = (DropDownList)gvr.FindControl("DDL_status");
}
//更新
protected void GV_Product_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
DropDownList ddl = (DropDownList)GV_Product.Rows[GV_Product.EditIndex].FindControl("DropDownList1");
Label lab = (Label)GV_Product.Rows[e.RowIndex].Cells[0].FindControl("lab_keepid"); //获得控件里的值
int identitys = Convert.ToInt32(ddl.SelectedItem.Value);
int id = Convert.ToInt32(lab.Text);
}
//编辑
protected void GV_Product_RowEditing(object sender, GridViewEditEventArgs e)
{
Label lab = (Label)GV_Product.Rows[e.NewEditIndex].Cells[0].FindControl("lab_keepid");
}
<asp:TemplateField HeaderText="用户Id" SortExpression="employeeId">
<EditItemTemplate>
编辑模板下应该放个你想得到模板
</EditItemTemplate>
<ItemTemplate>
<asp:DropDownList ID="DropDownList1" runat="server"></asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>有的话才能找到