Affeceunsoche
New Member
I have a textbox used for quantity alterations in a shopping cart that is in the form of a datagrid. When i click on the edit linkbutton it allows the textbox to be altered. What i'm trying to get is the altered text to then replace the original quantity in my dataTable. i've tried a bunch of different things but can't get the changed value to stick. Here is the code that ultimately changes the dataTable:\[code\] For Each objDR In myDataTable.Rows If objDR("ItemID") = intItemID Then objDR("Quantity") = Int32.Parse(myText) 'adding a specific int like 333 works Exit For End If Next\[/code\]As noted, if i place in a specific value like "333" then the quantity changes. So the issue must rest in the textbox value not being held when i click update, or at least that is how i see it.The code to access the textbox text I have tried:\[code\] Dim myText As String For Each dataGridItem As DataGridItem In dgCart.Items myText = CType(dataGridItem.FindControl("txtQuantity"), TextBox).Text 'myText = DirectCast(dataGridItem.FindControl("txtQuantity"), TextBox).Text Next have also tried 'Dim strQuantity As String = CType(dgCart.Items(0).FindControl("txtQuantity"), TextBox).Text\[/code\]and\[code\] 'Dim txtQuantity As TextBox = e.Item.FindControl("txtQuantity")\[/code\]I also tried messing with the txtbox's viewstate but that makes no difference.How do I fix this? Thanks in advance for any help.