Hi,
I am looping through a RadGrid and getting the contents of a RadNumericTextbox through each iteration. Every radNumericTextbox appears to be empty even though I have numbers in each of them. I've tested a regular textbox control in my radgrid and the numbers do show up.
Here's the code:
I check for radTxtQuantity.Text <> String.Empty before proceeding but it is always empty. Am I doing something wrong? It is never going into that If statement.
Thanks
I am looping through a RadGrid and getting the contents of a RadNumericTextbox through each iteration. Every radNumericTextbox appears to be empty even though I have numbers in each of them. I've tested a regular textbox control in my radgrid and the numbers do show up.
Here's the code:
| For Each item As GridDataItem In radGvProducts.Items |
| If TypeOf (item) Is GridDataItem Then |
| Dim txtQuantity As TextBox = CType(item.FindControl("txtQuantity"), TextBox) |
| If txtQuantity.Text <> String.Empty Then |
| 'do something |
| End If |
| Dim radTxtQuantity As RadNumericTextBox = CType(item.FindControl("radTxtQuantity"), RadNumericTextBox) |
| If radTxtQuantity.Text <> String.Empty Then |
| Dim intQty As Integer = CInt(radTxtQuantity.Text.Trim) |
| 'Dim hdnShoppingCartID As HiddenField = CType(rptItem.FindControl("hdnShoppingCartID"), HiddenField) |
| 'Dim shoppingCartID As Integer = CInt(hdnShoppingCartID.Value) |
| Dim hdnProductID As HiddenField = CType(item.FindControl("hdnProductID"), HiddenField) |
| Dim prodID As Integer = CInt(hdnProductID.Value) |
| Dim sc As New ShoppingCart(UserInstance.ContactID, prodID) |
| 'If UserInstance.ContactID > 0 Then |
| sc.ContactID = UserInstance.ContactID |
| 'Else |
| ' sc.UserID = DBNull.Value |
| 'End If |
| sc.ProductID = prodID |
| scsc.Quantity = sc.Quantity + intQty |
| ShopCartCol.Add(sc) |
| 'sc.Save() |
| End If |
| End If |
| Next |
Thanks