我试图在每次选择一个按钮时填充listview
。目前我每次都有按钮填充listview
一次。每次输入新值时,它都会覆盖当前的listview
。使用C#类型多次填充列表视图
我想能够添加一个新项目并继续,直到有多行。
protected void btnAddSkuBarcode_Click(object sender, EventArgs e)
{
var SKUS = new List<SkuBar>
{
new SkuBar {SkuBarcode = txtSkuBarcode.Text , Qty = txtQty.Text},
};
lvWebLabels.DataSource = SKUS;
lvWebLabels.DataBind();
}
public class SkuBar
{
public string SkuBarcode { get; set; }
public string Qty { get; set; }
}