WebForm,Winfrom下拉框添加全部行

WebForm:

        dropPostalLineNo.DataSource = "数据源";
        dropPostalLineNo.DataTextField = ""; //文本
        dropPostalLineNo.DataValueField = "";   //id
        dropPostalLineNo.DataBind();
        dropPostalLineNo.Items.Insert(0,(new ListItem("全部", "0"))); //添加全部行

 

WINFORM:
        DataTable db = "数据源";
        DataRow row = db.NewRow();
        row["id"] = "0";
        row["Name"] = "name";
        db.Rows.InsertAt(row, 0);

posted @ 2013-11-21 15:42  quanxie  Views(458)  Comments(0Edit  收藏  举报