Loading ...

Rebind gridview after removing shoppingcart items C#

Who is online?  0 guests and 0 members
home  »  forums   »  asp.net topics   »  web forms / data controls   » Rebind gridview after removing shoppingcart items C#

Rebind gridview after removing shoppingcart items C#

Posts under the topic: Rebind gridview after removing shoppingcart items C#

Posted: 11/15/2011

Lurker 10  points  Lurker
  • Joined on: 11/15/2011
  • Posts: 2

Hi I have built a shopping cart using the shopping cart instance class and a gridview control which also has a dropdown list nested in each row to allow users to select a size option.

If a user removes an item from the shopping cart instance we need to rebind the grid to remove the instance from the cart list, however it also resets the dropdowns to zero again losing their previous selections.

Is there a way to remember the dropdown list values when rebinding, I welcome ideas.


Posted: 11/16/2011

Lurker 10  points  Lurker
  • Joined on: 11/15/2011
  • Posts: 2

The approach I am thinking of taking is to create a guid  and save this along with the id of the product and the selected sizes to an orders temp table in DB, then after removing the row and when rebinding try to reset the sizes in the gridview item databind event.

Is there an easier way.


Page 1 of 1 (2 items)