How to read input from a textfield in a datagrid !?!

  • Thread starter Remco Groot Beumer
  • Start date
R

Remco Groot Beumer

Hello,

I'm working with a datagrid control in ASP.NET. The datagrid shows a list of
products. One column shows the productnumber, one column shows the
productname, one column shows a picture of the product and the last column
shows an empty textbox with an 'OK' button.

People can enter a quantity in the empty textbox. After clicking on the 'OK'
button, the product and quantity should be added to another datagrid. The
problem is that I don't know how to read the quantity. I now do this as
follows (cells(5) is the template-column with the textbox, the 'OK' button
triggers the SelectedIndexChanged event):

Private Sub grdArtikelen_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles grdArtikelen.SelectedIndexChanged

Dim txb As TextBox
=CType(Me.grdProducts.SelectedItem.Cells(5).Controls(1), TextBox)

Dim dblQuantity As Double

dblQuantity = CType(txb.Text, Double)

End Sub



This code gets the right textbox, but the TEXT property is always empty. How
can I get the text that has been entered in the textbox?

Any help would be appreciated.

Greetings,

Remco
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,479
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top