girdvIEw行裡編輯時有DropDownList,DropDownList的默認選擇值處理:

protected void gdvUserList_RowDataBound(object sender, GridVIEwRowEventArgs e)


...{

if(this.gdvUserList.EditIndex>=0 && this.gdvUserList.EditIndex==e.Row.DataItemIndex)

((DropDownList)e.Row.Cells[2].Controls[1]).SelectedValue = DataBinder.Eval(e.Row.DataItem,"GroupType").ToString();

}