473,503 Members | 2,136 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Access TextBox.Text inside a Dynamically Created Table

I'm using a table (dynamically generated at runtime) for formatting wherein I have text in the first column, and textboxes in the second column. For example, (1,1) might have the string "Last Name" and (1,2) has a textbox where the user can type the last name; (2,1) "First Name", and (2,2) a textbox, and so forth. The code to it is:

dim table_test As System.Web.UI.WebControls.Table

For rowCount = 0 To 3
Dim column1 As New TableCell()
Dim column2 As New TableCell()
Dim row As New TableRow()

column1.Controls.Add(New LiteralControl("something"))
column2.Controls.Add(New TextBox())

row.Cells.Add(column1)
row.Cells.Add(column2)

table_test.Rows.Add(row)
Next

Once the table is generated, and presented, how can I fetch the contents of the textboxes in the second column? The following does not work because I don't want the text within the cell, I want the text within the textbox within the cell (I'm assuming the rows and cells are zero origined, I might be wrong):

dim s as string
s = table_test.rows(0).cells(1).text

Any suggestions will be greatly appreciated!
Nov 20 '05 #1
2 2565
This is not really the right newsgroup for this question you should have
placed it in ASPNET. However, dont do it this way. just use a datagrid, much
easier.

Regards - OHM
"Newbee" <an*******@discussions.microsoft.com> wrote in message
news:7F**********************************@microsof t.com...
I'm using a table (dynamically generated at runtime) for formatting wherein I have text in the first column, and textboxes in the second column.
For example, (1,1) might have the string "Last Name" and (1,2) has a textbox
where the user can type the last name; (2,1) "First Name", and (2,2) a
textbox, and so forth. The code to it is:
dim table_test As System.Web.UI.WebControls.Table

For rowCount = 0 To 3
Dim column1 As New TableCell()
Dim column2 As New TableCell()
Dim row As New TableRow()

column1.Controls.Add(New LiteralControl("something"))
column2.Controls.Add(New TextBox())

row.Cells.Add(column1)
row.Cells.Add(column2)

table_test.Rows.Add(row)
Next

Once the table is generated, and presented, how can I fetch the contents of the textboxes in the second column? The following does not work because I
don't want the text within the cell, I want the text within the textbox
within the cell (I'm assuming the rows and cells are zero origined, I might
be wrong):
dim s as string
s = table_test.rows(0).cells(1).text

Any suggestions will be greatly appreciated!

Nov 20 '05 #2
Cor
Hi OHM,

In my opinion is this on the edge if this is not the right newsgroup, but I
would not have answered this if it was not your first datagrid web answer.

:-))))))

Cor
Nov 20 '05 #3

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

Similar topics

1
7869
by: Dom Nicholas | last post by:
Hi, I have a table (inside a form) that is dynamically created ie the user can add / remove rows dynamically. Each table row has 4 columns : a selection pull down list a text field for...
7
2710
by: Gelios | last post by:
Hello all! I have a Windows.Forms code where I dynamically created controls. How can I access to properties from event handler? For example: createSomeControls() { TextBox textBox = new...
4
507
by: Newbee | last post by:
I'm using a table (dynamically generated at runtime) for formatting wherein I have text in the first column, and textboxes in the second column. For example, (1,1) might have the string "Last Name"...
7
7046
by: ddecoste | last post by:
I have a need to add a visual representation to some data in Access. I need to draw a matix of squares inside another square. I have all the data that I need in a record in Access. The data...
16
5122
by: mj.redfox.mj | last post by:
Can anyone help? I have a textbox which I'm programatically adding by using the following code: txtTest = New TextBox txtTest.ID = "txtLeft" + cntCount.ToString...
7
2876
by: robert.waters | last post by:
I have an Access database frontend linked via ODBC to a large (gigabytes) mysql database. I need to view a large amount of data in a a textbox (variable up to 300K), but I receive a 'there isnt...
7
2281
by: Andy B | last post by:
I have a class I am creating for data access. I need to access controls from inside the class that are on a particular page. How do I do this? or is creating an instance of the page class and using...
4
4740
by: =?Utf-8?B?RHlsYW5TbWl0aA==?= | last post by:
I have a WebForm where I'm dynamically creating some controls and I'm having difficulty understanding how the state is being persisted and how to work with it. I've created a simplified example...
1
6293
by: JFKJr | last post by:
Hello everyone, the following Access VBA code opens an excel file and creates textboxes in a given range of cells dynamically. The code attaches "MouseUP" and "Exit" events to the textboxes (using...
2
2187
by: savianand | last post by:
I want to know the code how to save data from dynamically created textboxes. The code I have written is this in whch I have dynamically created label and textboxes in a html table.The data in the...
0
7204
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
7091
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...
0
7282
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7342
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5586
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
5018
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
4680
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
3171
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1516
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.