Python语言技术文档

微信小程序技术文档

php语言技术文档

jsp语言技术文档

asp语言技术文档

C#/.NET语言技术文档

html5/css技术文档

javascript

点击排行

您现在的位置:首页 > 技术文档 > C#/.NET入门教程

gridview和checkboxlist的嵌套相关应用

来源:中文源码网    浏览:155 次    日期:2024-05-08 07:26:03
【下载文档:  gridview和checkboxlist的嵌套相关应用.txt 】


gridview和checkboxlist的嵌套相关应用
复制代码 代码如下:
复制代码 代码如下:protected void gvItem_RowCommand(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { CheckBoxList oGridView = (CheckBoxList)e.Row.FindControl("gvInnerItem"); if (oGridView != null) { string state = gvItem.DataKeys[e.Row.RowIndex].Value.ToString(); string sql = string.Format("select distinct(city) from CELLPHONESORT where state='{0}'", state); DataSet ds = MyDB.GetDataSet(sql); oGridView.DataSource = ds.Tables[0].DefaultView; oGridView.DataValueField = "city"; oGridView.DataTextField = "city"; oGridView.DataBind(); } } }

相关内容