473,473 Members | 2,104 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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

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).Contro ls(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



Nov 17 '05 #1
1 1227
> dblQuantity = CType(txb.Text, Double)
I guess this should be

dblQuantity = CType(txb.Value, Double)

"Remco Groot Beumer" <in**@rgbplus.nl> wrote in message news:<bo**********@news3.tilbu1.nb.home.nl>...
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).Contro ls(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

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: TJ | last post by:
Dear PHP group, First question: I have an input form that upon pressing a button validates the values entered into this form. I am using the following code recall this form if there is an...
4
by: Mikko | last post by:
Is it possible to read "label" from form-field? <label for="product1">bread</label> <input id="product1" name="product1" type="text" size="3"> number comes with $_GET; but how do I read the...
2
by: luke | last post by:
I'm trying to use an image as a background for a text input box. <form> <fieldset><input type="text" name ="blah" class="cheese"></fieldset> </form> I'm using this code as part of my css to...
13
by: Stumped and Confused | last post by:
Hello, I really, really, need some help here - I've spent hours trying to find a solution. In a nutshell, I'm trying to have a user input a value in form's textfield. The value should then be...
2
by: TTD | last post by:
Hi, I have a form (input type) which is based on a table. Let's say it has 2 fields 1: numeric keyfield 2: textfield. When the form opens the numeric is automatically added with 1. When I...
3
by: cbradio | last post by:
Hi, I am having trouble developing a form in a restricted environment. My sample code is found below my message (sorry I don't have a URL). Basically, without a doctype, the form displays properly...
1
by: SkipNRun | last post by:
I am a novice when comes to JavaScript, AJAX. I am working on a form, which will allow users to update their contact information. In order to make the form flexible, I need to use pull down list. ...
4
by: Michael Munch | last post by:
Hi I want to read the value of af text-field, create dynamic, in a form. Se below a small test-site to do that (but readning fails): I use the function Test_Read for reading the value from the...
6
by: Per Juul Larsen | last post by:
Hi. My Textfile looks like this Variable 1 Variable 2 Variable 3 Variable 4 On opening the application it will read the textfile, and assign each line of variable to at textfield in VB and...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.