2008-01-18 17:48:41 臉。扭曲 ()
我在GridView 里套 GridView
GridView gv = (GridView)row.FindControl("GridView2");
DropDownList DDL1 = (DropDownList)gv.FooterRow.FindControl("DDLClassFatherID1");
DDL1.DataSource = Data.GetDataSet(0, 1);
DDL1.DataTextField = "ClassName";
DDL1.DataValueField = "ClassID";
DDL1.DataBind();
报错说未将DropDownList 对象引用置对象的实例
2008-01-18 17:49:47 布川内酷()
今天刚来,请大家多关照。
2008-01-18 17:50:05 臉。扭曲 ()
每人回答吗?
2008-01-18 17:50:11 ·()
哈哈,队伍发展的真快
2008-01-18 17:50:32 ·()
有会的就回答了,我是菜鸟一个,,,
2008-01-18 17:50:37 臉。扭曲 ()
GridView gvtemp = (GridView)sender;
gvUniqueID = gvtemp.UniqueID;
Info.ClassID = Convert.ToInt32(((Label)gvtemp.Rows[e.RowIndex].FindControl("lbClassID1")).Text.Trim());
Info.ClassName = ((TextBox)gvtemp.Rows[e.RowIndex].FindControl("EditClassName1")).Text.Trim();
Info.ClassFatherID = Convert.ToInt32(((Label)gvtemp.Rows[e.RowIndex].FindControl("lbClassFatherID1")).Text.Trim());
这样能获取到textbox的值 闷 对象却获取不到
2008-01-18 17:51:19 臉。扭曲 ()
速度阿
2008-01-18 17:51:22 臉。扭曲 ()
要下班了..
2008-01-18 17:54:01 51aspx大哥()
为什么要用FooterRow?
2008-01-18 17:54:28 臉。扭曲 ()
因为我在footer添加值
2008-01-18 17:55:14 51aspx支持()
问题肯定出在这里 自己仔细检查一下吧
2008-01-18 17:55:17 臉。扭曲 ()
[图片]
2008-01-18 17:56:51 臉。扭曲 ()
我仔细检查N边了 ..而且我在外面的GridView Editing 分类ID 的DropDownList 也绑定不到值
2008-01-18 17:57:05 臉。扭曲 ()
[图片]
2008-01-18 17:57:42 臉。扭曲 ()
GridViewRow row = e.Row;
DropDownList DDL = (DropDownList)row.FindControl("DDLClassFatherID");
DDL.DataSource = Data.GetDataSet(0, 1);
DDL.DataTextField = "ClassName";
DDL.DataValueField = "ClassID";
DDL.DataBind();
DDL.Items.Insert(0, new ListItem("设为一级分类", ""));
2008-01-18 17:57:54 51aspx支持()
试试看 BottomPagerRow.Cells[0].FindControl
2008-01-18 17:59:34 臉。扭曲 ()
DropDownList DDL1 = (DropDownList)gv.BottomPagerRow.FindControl("DDLClassFatherID1");
DDL1.DataSource = Data.GetDataSet(0, 1);
DDL1.DataTextField = "ClassName";
DDL1.DataValueField = "ClassID";
DDL1.DataBind();
DDL1.Items.Insert(0, new ListItem("设为一级分类", ""));
2008-01-18 18:00:01 臉。扭曲 ()
对不对?
未将对象引用设置到对象的实例。
DropDownList DDL1 = (DropDownList)gv.BottomPagerRow.FindControl("DDLClassFatherID1");
2008-01-18 18:03:24 臉。扭曲 ()
支持大哥..谢 被你提示了一下 呵呵
2008-01-18 18:03:35 臉。扭曲 ()
51aspx大哥 谢了
2008-01-18 18:03:44 ·()
出来了?
2008-01-18 18:04:00 51aspx支持()
问题出在哪里知道了吧
2008-01-18 18:04:08 臉。扭曲 ()
DropDownList DDL1 = (DropDownList)gv.FooterRow.Cells[2].FindControl("DDLClassFatherID1");
2008-01-18 18:04:10 臉。扭曲 ()
恩 知道了..
2008-01-18 18:04:20 ·()
[表情]
2008-01-18 18:04:59 51aspx支持()
我也是在
http://www.51aspx.com/searchall.aspx中搜 findcontrol找到的
2008-01-18 18:05:11 51aspx支持()
看来
http://www.51aspx.com/searchall.aspx还是蛮管用的嘛
2008-01-18 18:05:17 臉。扭曲 ()
这么牛阿 .
2008-01-18 18:05:21 51aspx支持()
回去安心吃饭啦
2008-01-18 18:05:21 ·()
呵呵
2008-01-18 18:05:30 臉。扭曲 ()
以后我也去搜搜 呵呵
2008-01-18 18:06:13 臉。扭曲 ()
Info.ClassID = Convert.ToInt32(((Label)GridView1.Rows[e.RowIndex].FindControl("lbClassID")).Text.Trim());可是这样我没有设置单元格 一样获取的lable的值