Solved

Updating quantity in GridView

Posted on 2009-05-11
2
475 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
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…
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…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

752 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