Solved

Updating quantity in GridView

Posted on 2009-05-11
2
479 Views
Last Modified: 2013-11-27
Hi guys,

I have a GridView in my cart. Everything works perfectly. The columns are auto-generated with the following code. I want to have textboxes in quantity column instead of just text. I want users to be able to input new quantity value and click button Update Quantities in order to update quantities for the items quantities of which were changed. Or any other way that you can offer of doing that. Newegg.com cart does this beautifully.

Thank you.

Dim strSQL1 As String = "SELECT P.Title, P.Artist, P.Price, SUM(P.Price) AS SubTotal, Count(P.ProductID) AS Qty FROM Products P, Cart C WHERE C.SessionID='" & _
                                    Session.SessionID & "' AND P.ProductID=C.ProductFK1 GROUP BY P.Title, P.Artist, P.Price"
 
Dim sqlCommand1 As New System.Data.SqlClient.SqlCommand(strSQL1, sqlConnection)
Dim rdr As System.Data.SqlClient.SqlDataReader = sqlCommand1.ExecuteReader
Dim dt As System.Data.DataTable = New System.Data.DataTable
dt.Load(rdr)
GridView1.DataSource = dt
GridView1.DataBind()

Open in new window

0
Comment
Question by:RealSnaD
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 24358212
I would think that if you want edit controls (TextBox, DropDownList, ...), then it would be better to define the columns as TemplateFields, and then define the edit controls in the EditItemTemplate.
0
 
LVL 7

Author Comment

by:RealSnaD
ID: 24413958
That's what I did, thanks!
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question