Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Updating quantity in GridView

Posted on 2009-05-11
2
Medium Priority
?
486 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:Yury Merezhkov
[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 2000 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:Yury Merezhkov
ID: 24413958
That's what I did, thanks!
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

721 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