473,396 Members | 2,036 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 2558
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
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
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
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
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
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
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
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
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
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
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
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,...
0
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...

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.