我在datagrid的模板列中加了一个dropdownlist控件,如果当我在dropdownlist中选择了某一项数据时,这时怎么来同步更新datagrid中某一列的数据呢?

解决方案 »

  1.   

    选择以后你得在dropdownlist的selectedindexchange的事件里面重新查询数据库得到数据集
    当然dropdownlist的autopostback得设置为true
      

  2.   

    问题是现在我根本就没办法获取dropdownlist的事件啊。dropdownlist是嵌套在datagrid控件的模板列中的。
      

  3.   

    在datagrid的itemcreated事件里面添加委托,
      

  4.   

    private void DataGrid1_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e){
     DropDownList DDL=(DropDownList)e.Item.FindControl("ProductTypeDDL");
    --DDL定义DDL的事件或者属性
    }只能给提示 呵呵。。具体我也没操作过