Exemplo n.º 1
0
        protected void GridView2_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            List <itemsuppliers> cclist = (List <itemsuppliers>)Session["cclist"];
            string        id            = GridView2.DataKeys[e.RowIndex].Values[0].ToString();
            itemsuppliers ll            = new itemsuppliers();

            ll = cclist.Where(x => x.ItemId.Equals(id)).First();
            cclist.Remove(ll);
            GridView2.DataSource = cclist;
            GridView2.DataBind();
        }
Exemplo n.º 2
0
        protected void GridView2_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            List <itemsuppliers> cclist = (List <itemsuppliers>)Session["cclist"];
            GridViewRow          row    = GridView2.Rows[e.RowIndex];
            string        id            = GridView2.DataKeys[e.RowIndex].Values[0].ToString();
            itemsuppliers ll            = new itemsuppliers();

            ll                   = cclist.Where(x => x.ItemId.Equals(id)).First();
            ll.ReOrderQty        = Convert.ToInt16((row.FindControl("TextBox1") as TextBox).Text);
            GridView2.EditIndex  = -1;
            GridView2.DataSource = cclist;
            GridView2.DataBind();
        }