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);

上一篇:一行实现QQ群组头像,微信群组,圆角等效果. 并支持url直接加载图片


下一篇:linux基础-第六单元 用户、群组和权限