日期:2014-05-20  浏览次数:20380 次

在控件gridview中嵌套二个dropdownlist控件,二个dropdownlist控件可否做到联动?如能该怎么写!~~~~~~急~
在控件gridview中嵌套二个dropdownlist控件,二个dropdownlist控件可否做到联动?如果能联动,具体该怎么写??谢谢?

------解决方案--------------------
完全可以
------解决方案--------------------
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
if(!Page.IsPostBack)
{
string strSQL;
OracleConnection cn=new OracleConnection(ConfigurationSettings.AppSettings[ "ConnectionString "]);
cn.Open();
strSQL= "select business from jiangb_xywgl_business_detail group by business ";
OracleCommand objCmd = new OracleCommand(strSQL,cn);
OracleDataReader objReader = objCmd.ExecuteReader();
DDLbusiness.DataSource=objReader;
DDLbusiness.DataTextField= "business ";
DDLbusiness.DataValueField = "business ";
DDLbusiness.DataBind();
}

private void DDLbusiness_SelectedIndexChanged(object sender, System.EventArgs e)
{
string strSQL;
OracleConnection cn=new OracleConnection(ConfigurationSettings.AppSettings[ "ConnectionString "]);
cn.Open();
strSQL= "select content from jiangb_xywgl_business_detail where business = ' "+DDLbusiness.SelectedItem.Text+ " ' ";
OracleCommand objCmd = new OracleCommand(strSQL,cn);
OracleDataReader objReader = objCmd.ExecuteReader();
DDLcontent.DataSource=objReader;
DDLcontent.DataTextField= "content ";
DDLcontent.DataValueField = "content ";
DDLcontent.DataBind();
cn.Close();
}
------解决方案--------------------
see:
http://huobazi.cnblogs.com/archive/2006/04/08/TwoDropDownListInDataGridAndBubbleEvent.html