RadioButtonList1.SelectedIndex=0;
不就是规定了他选中第一个吗?

解决方案 »

  1.   

    是啊,
    但是在ItemDataBound这个环境下就是不能让产生被选中
    我该怎么办??
      

  2.   

    重载DataGrid的ItemCreated
    下面有一段代码,我试过了,可以使用
    public void OnItemCreate(object sender,DataGridItemEventArgs e)
    { RadioButtonList list=(RadioButtonList)e.Item.Cells[2].FindControl("RBL_State");
    if(list!=null && DT!=null && iCount<DT.Rows.Count)
    {
    list.SelectedIndex=Convert.ToInt32(DT.Rows[iCount]["state_index"]);
    iCount++;
    }
    }
    DT和iCount是全局变量