在Formview的ItemTemplate的Lable显示的数据是几个枚举的值  所以在EditItemTemplate必须用一个Dropdownlist来供用户选折  Dropdownlist的数据来自有数据库  当时怎样让他在绑定的时候
自动选择ItemTemplate的Lable显示的数据的那一项呢

解决方案 »

  1.   

    //****在后台写一个函数
    public dataset GetDataBaset()
    {
       return dset;
    }//****在前datasource邦定就可以了
      

  2.   

    在ItemDataBound事件的处理程序中进行判断
      

  3.   

    dropdownlist.Items.FindByText("xxx").selected=true;
    其中xxx写上你要绑定的项。
      

  4.   

    问题是xxx是ItemTemplate的Lable的值  有findcontrol好像取不到他的值 
    请注意 这不是一般的情况  是在formview中
      

  5.   

    自己坚决了 选择数据源+绑定selectvalue
      

  6.   

    可是不知道怎样才能在dropdownlist输入他的索引就自动填充他的值   
    大家有什么办法吗