Results 1 to 3 of 3

Thread: [RESOLVED] Problem with GridView Deleting Basket Class Data

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2010
    Posts
    25

    Resolved [RESOLVED] Problem with GridView Deleting Basket Class Data

    BasketBLL class
    Code:
        public void RemoveBasketItem(int index)
        {
            _basketItems.RemoveAt(index);
        }
    Cart.aspx
    In Events: Row Deleting
    Code:
        protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            int rowToDelete = e.RowIndex;
            TextBox4.Text = rowToDelete.ToString();
            Basket DeleteBasket = new Basket();
            DeleteBasket.RemoveBasketItem(rowToDelete);
            GridView1.DataBind();
        }
    Error: Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index

    Anyone have any idea how to solve this?

  2. #2
    Fanatic Member
    Join Date
    Aug 2009
    Posts
    540

    Re: Problem with GridView Deleting Basket Class Data

    This looks like a block of C code, wrong forum my friend.
    Where I'm from we only have one bit of advice for new comers: "If you hear banjos, turn and run".


    VS 2008 .NetFW 2.0

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Feb 2010
    Posts
    25

    Re: [RESOLVED] Problem with GridView Deleting Basket Class Data

    Yes, sorry my fault I copied it over to the C# now. Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width