473,320 Members | 1,724 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,320 software developers and data experts.

Dynamic Variables? OR Dynamic Controls

Ello...

What I'm trying to do is have a page layout with x columns by 4 rows. The
first row would be names pulled from a dataset. The second row would be
checkboxes - each being its own checkboxlist (maybe - is there a better way?)
that would be 'associated' with the above picture. The 3rd/4th rows are the
same, with different data.

Now, I'd like to be able to do a for loop, which is easy for the first/third
rows. But when the controls pop up, I'm at a loss for how to do those
without putting in the code to add each control separately.

Any suggestions?
Nov 18 '05 #1
1 1037
Hi teros:

You can use a for loop to loop through controls on a page, or controls
in a section of the page:

foreach(Control c in Controls)
{
// you can test if the control is one you are looking for:
if(c is TextBox)
{
// do some work
}
}

Every control on a webform has a Controls collection of child
controls. You can pick just the collection where you need to examine
each control.

Does this help?

--
Scott
http://www.OdeToCode.com

On Mon, 9 Aug 2004 18:57:03 -0700, "Teros"
<Te***@discussions.microsoft.com> wrote:
Ello...

What I'm trying to do is have a page layout with x columns by 4 rows. The
first row would be names pulled from a dataset. The second row would be
checkboxes - each being its own checkboxlist (maybe - is there a better way?)
that would be 'associated' with the above picture. The 3rd/4th rows are the
same, with different data.

Now, I'd like to be able to do a for loop, which is easy for the first/third
rows. But when the controls pop up, I'm at a loss for how to do those
without putting in the code to add each control separately.

Any suggestions?


Nov 18 '05 #2

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

Similar topics

7
by: Mark | last post by:
I want to create textboxes dynamically but with dynamic names also. i am retrieveing a load of values from a table in SQL into a DataReader. Then i want to create textboxes from those variables. ...
1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
1
by: Will | last post by:
Hi all. I'm learning VB.Net and am developing a WinForms app. I'm trying to make an app that I will use to scan in one or more than on image. I want to use a tabbed interface to hold each image....
9
by: wASP | last post by:
Hello again to all of you geniuses, I'm having a problem trying to load dynamic controls at the initialization phase. I've read the docs, and I thought I had it figured out:...
6
by: hb | last post by:
Hi, I have a page bill.aspx and its code-behind bill.aspx.cs. On bill.aspx I have: === Select a month: <asp:dropdownlist runat="server" id="lstDate" autopostback="True" /> <br> <asp:table...
1
by: brian | last post by:
This is the first time I have tried to create dynamic controls. I am trying to create a hyperlink control. The control will display properly but the event isn't triggered. I read a lot of...
3
by: PABruceFan | last post by:
I am dynamically adding rows to an asp:table as a result of a database query. The row consists of a label, a textbox and three checkboxes in that order: LABEL TEXTBOX CHECKBOX1 CHECKBOX3 ...
13
by: rn5a | last post by:
In a shopping cart app, suppose a user has placed 5 orders, I want to show him 5 LinkButtons (one for each order) so that when he clicks the first LinkButton, he would be shown the details of his...
2
by: BillE | last post by:
I have a web form which has dynamic controls for order entry, (item selected, #,etc.) which are wired to an event handler which fires when the dynamic controls content changes. These controls...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.