如题 
怎样对gridview 中的  dropdownlist的下拉表后台绑定
非数据库绑定下拉显示   
0
1
2
3

解决方案 »

  1.   

    GridView实例
      

  2.   

    非数据?那0123是什么东西 ID么?
                
                DropDownList1.DataSource = ds;
                DropDownList1.SelectedIndex=;
                DropDownList1.SelectedValue=;绑定就这样
      

  3.   

    先生,不是DataSource绑定的噢类似于  
    DropDownList1.Items.Insert(0,"他妈的")
    DropDownList1.Items.Insert(1,"他娘的")
    DropDownList1.Items.Insert(1,"他干妈的")
      

  4.   

    先生,不是DataSource绑定的噢类似于   
    DropDownList1.Items.Insert(0,"他妈的")
    DropDownList1.Items.Insert(1,"他娘的")
    DropDownList1.Items.Insert(2,"他干妈的")
      

  5.   

    第一点,你没有跟我说是datatable还是直接Insert吧。
    第二点,看到你的回帖,我真的不想回答这个问题。
      

  6.   


    非常抱歉
    哈哈
    是insert
    其实 我是页面上  一个dropdownlist1   一个gridview  里面的dropdownlist2
    通过 dropdownlist1 选项  改变  gridview里的dropdownlist2
      

  7.   

    你的DropDownList1在gridview 中你要先通过这个找到该对象
    DropDownList ddl=(DropDownList)this.Gridview1.FindControl("下拉框的Id名称");
    ddl.Items.Insert(0,new ListItem("显示值","值"));
    ddl.Items.Insert (1,new ListItem("显示值","值"));
    这样就可以给你的GridView中的DropDownList赋值了希望可以帮到你,你试下
      

  8.   

    如果是这样也是一样的 只要你将你的DropDownList1中选中的值给定Dropdownlist2作为查询的添加就可以了 赋值的话和上面的是一样的
      

  9.   

    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
      if (e.Row.RowType == DataControlRowType.DataRow)
      {
         DropDownList DropDownList1 = (DropDownList)e.Row.FindControl("DropDownList1");
         DropDownList1.Items.Insert(0,new ListItem ("","0"));
      }
    }
      

  10.   

    Dropdownlist1在 Gridview 外的
    提示  未将对象设置到实例噢
      

  11.   

    DropDownList1.DataSource = ds.Tables[0];
    DropDownList1.SelectedIndex="Name";
    DropDownList1.SelectedValue="Value";
    这样应该可以。