本帖最后由 weiheng610913630 于 2014-05-12 15:15:57 编辑

解决方案 »

  1.   

    我知道加where 条件  我是问如何获取上级大组id
      

  2.   

      <asp:DropDownList  AutoPostBack="true" ID="test" runat="server"  OnSelectedIndexChanged="test_SelectedIndexChanged">
      <asp:ListItem>dddddd</asp:ListItem>
        <asp:ListItem>33333</asp:ListItem>
        <asp:ListItem>3444443</asp:ListItem>
         </asp:DropDownList>
    protected void test_SelectedIndexChanged(object sender, EventArgs e)
    {
     var yesye = ((DropDownList)sender).SelectedValue;
     Response.Write(yesye.ToString());//取得大组的值然后去数据库取出对应的小组的shu
    然后在 绑定小组的数据
    for(int i = 0;i < DataGrid1.Items.Count;i++)
    {
    DropDownList ddl1 = (DropDownList)DataGrid1.Items[i].FindControl("DropDownList2");
     //取得数据绑定
    }
    }
      

  3.   

    怎么取出小组数据啊,   为什么我循环出来的DropDownList ddl1 = (DropDownList)DataGrid1.Items[i].FindControl("DropDownList2");为空。
    这是我前台小组控件绑定   <asp:DropDownList id="TBMinGroup" runat="server" Width="88px" Datasource="<%#TBMinGroup()%>" 
                                       DataValueField="MinGroupID" DataTextField="MinGroupName" Enabled="true" AutoPostBack="True">
                      </asp:DropDownList> 不知道对不对
      

  4.   

    人家写DropDownList2你也写这个,你的dropDownList的ID都不是这个
      

  5.   

    test_SelectedIndexChanged
    就是这个呗