Example #1
0
    protected void btnAllStock_Click(object sender, EventArgs e)
    {
        //create an instance of clsStockCollection
        clsStockCollection Stock = new clsStockCollection();

        Stock.ClearFilter();
        lstStock.DataSource = Stock.StockList;
        //set name of primary key
        lstStock.DataValueField = "ItemId";
        //set name of field to display
        lstStock.DataTextField = "ItemName";
        //bind data to the list
        lstStock.DataBind();
    }