Traversing a DataGrid

coronis

New Member
Hi, <BR><BR>I have used a DataGrid to display a Shopping Basket. I have one of the columns set as a textbox. I have no trouble retrieving the info from the database but I have a bit of a problem when I want to push the changed data (i.e. changed quantity values) back to the source DB. <BR><BR>I have seen many e.g's of code traversing an individual row of a datagrid, but what I need to do is, loop through every row, collecting changed quantity values and push them back to the source database. <BR><BR>Has anybody done this kind of thing? and do you have any code examples.<BR><BR>Regards & Thanks<BR>Paul?<BR>Dim Cols As String() = {"ProductNumber", "ProductName", "ProductPrice", "ProductQuanity"} <BR><BR>Dim Currenttextbox as Textbox<BR>Dim item As DataGridItem<BR><BR>For Each item in MyDataGrid.Items<BR> for i = 0 to Cols.Length - 1<BR> Currenttextbox = item.FindControl(Cols(i))<BR> Response.Write "Cols:" Cols(i) & " " & Currenttextbox.Text & VBCRLF<BR> next<BR>nextThank you very much! That's exactly what I was looking for, and it works exactly like I wanted.<BR><BR>I don't hate the DataGrid after all :-)<BR><BR>Thanks Again<BR>Paul
 
Back
Top