Results 1 to 2 of 2

Thread: Updating a datagrid

Threaded View

  1. #2

    Thread Starter
    Hyperactive Member Rocketdawg's Avatar
    Join Date
    Feb 2003
    Location
    Back in the doghouse
    Posts
    294

    Re: Updating a datagrid

    Never mind

    Changed the load event to

    VB Code:
    1. Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    2.        
    3.         objCartDT = Session("Cart")
    4.         If objCartDT Is Nothing Then
    5.             lblNoItems.Text = "There are no items in your cart."
    6.         Else
    7.             lblTotal.Text = "Total: $" & GetItemTotal()
    8.         End If
    9.  
    10.         If Not IsPostBack Then
    11.             ' need to load this data only once
    12.             BindGrid()
    13.         End If
    14.  
    15.     End Sub
    16.  
    17.     Sub BindGrid()
    18.         dgCart.DataSource = objCartDT
    19.         dgCart.DataBind()
    20.     End Sub

    And it works fine now.
    Last edited by Rocketdawg; Jul 29th, 2005 at 12:31 PM.

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