Solved

Updating quantity in GridView

Posted on 2009-05-11
2
460 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
2 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
Comment Utility
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
Comment Utility
That's what I did, thanks!
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now