(WEB开发)在DataGrid里有两个模板列,每个列里包含一个DropDownList ;假设为:dl1,dl2 ;我想对这两个实现联动。也就是,在dl1触发SelectedIndexChanged事件时,dl2显示的东西要跟着变。我代码如下:
private void dgexcel_ItemDataBound(object sender,   System.Web.UI.WebControls.DataGridItemEventArgs e)
{
     Funct ft=new Funct();
     DataTable dt=null;
     dge=e;
if(e.Item.ItemType==ListItemType.Item||e.Item.ItemType==ListItemType.AlternatingItem)
     {
DropDownList dlr=((DropDownList)e.Item.FindControl("dlrclass"));
DropDownList dls=((DropDownList)e.Item.FindControl("dlsclass"));
dt=ft.getrclass();
dlr.DataSource=dt;
dlr.DataTextField="fname";
dlr.DataValueField="fid";
dlr.DataBind();
dt.Clear();
dlr.SelectedIndexChanged+=new EventHandler(dlr_SelectedIndexChanged);
dt=ft.getsclass(dlr.SelectedValue.Trim());
dls.DataSource=dt;
dls.DataTextField="fname";
dls.DataValueField="fid";
dls.DataBind();
dt.Clear();绑定事件如下:private void dlr_SelectedIndexChanged(object sender, EventArgs e)
{
DropDownList dls=((DropDownList)dge.Item.FindControl("dlsclass"));
string fid=((DropDownList)sender).SelectedValue;
Funct ft=new Funct();
DataTable dt=ft.getsclass(fid);
dls.DataSource=dt;
dls.DataTextField="fname";
dls.DataValueField="fid";
dls.DataBind();
}现在有两个问题:一是,事件好象触发不了;二是在dl1触发后怎么去确定跟他同在一行的dl2。