Dynamically added controls

C

Chris

I have a page with mixture of static and dynamically added controls is there
any way of controlling the order which they are added to the page. My submit
button (statically added) appears before some textboxes (dynamically added).
I know I could move it around with CSS but I want to move towards an
accessible site that will display forms in the right order without CSS.
Regards, Chris.
 
E

Eliyahu Goldin

Even if you are creating controls dynamically, you can always prepare your
layout statically. Drop a table on the form before the buttons and add rows
for the textboxes as you add them.
 
C

Chris

I am designing something which creates forms dynamically bar a submit button
and one or two other controls. A static layout would sort of defeat the
object of doing it dynamically. Regards, Chris.

Eliyahu Goldin said:
Even if you are creating controls dynamically, you can always prepare your
layout statically. Drop a table on the form before the buttons and add
rows
for the textboxes as you add them.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin


Chris said:
I have a page with mixture of static and dynamically added controls is there
any way of controlling the order which they are added to the page. My submit
button (statically added) appears before some textboxes (dynamically added).
I know I could move it around with CSS but I want to move towards an
accessible site that will display forms in the right order without CSS.
Regards, Chris.
 
E

Eliyahu Goldin

You can add controls to the container's Control collection with AddAt
method, which lets you specify a specific location in the collection.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin


Chris said:
I am designing something which creates forms dynamically bar a submit button
and one or two other controls. A static layout would sort of defeat the
object of doing it dynamically. Regards, Chris.

Eliyahu Goldin said:
Even if you are creating controls dynamically, you can always prepare your
layout statically. Drop a table on the form before the buttons and add
rows
for the textboxes as you add them.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin


Chris said:
I have a page with mixture of static and dynamically added controls is there
any way of controlling the order which they are added to the page. My submit
button (statically added) appears before some textboxes (dynamically added).
I know I could move it around with CSS but I want to move towards an
accessible site that will display forms in the right order without CSS.
Regards, Chris.
 
C

Chris

What about statically added controls?

Eliyahu Goldin said:
You can add controls to the container's Control collection with AddAt
method, which lets you specify a specific location in the collection.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin


Chris said:
I am designing something which creates forms dynamically bar a submit button
and one or two other controls. A static layout would sort of defeat the
object of doing it dynamically. Regards, Chris.

Eliyahu Goldin said:
Even if you are creating controls dynamically, you can always prepare your
layout statically. Drop a table on the form before the buttons and add
rows
for the textboxes as you add them.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin


I have a page with mixture of static and dynamically added controls is
there
any way of controlling the order which they are added to the page. My
submit
button (statically added) appears before some textboxes (dynamically
added).
I know I could move it around with CSS but I want to move towards an
accessible site that will display forms in the right order without
CSS.
Regards, Chris.
 
E

Eliyahu Goldin

They are also in the Controls collection. Inspect it in the debugger, it
will give you a better picture of what is there and in what position.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


Chris said:
What about statically added controls?

Eliyahu Goldin said:
You can add controls to the container's Control collection with AddAt
method, which lets you specify a specific location in the collection.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin


Chris said:
I am designing something which creates forms dynamically bar a submit button
and one or two other controls. A static layout would sort of defeat the
object of doing it dynamically. Regards, Chris.

message Even if you are creating controls dynamically, you can always prepare your
layout statically. Drop a table on the form before the buttons and
add
rows
for the textboxes as you add them.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin


I have a page with mixture of static and dynamically added controls
is
there
any way of controlling the order which they are added to the page. My
submit
button (statically added) appears before some textboxes (dynamically
added).
I know I could move it around with CSS but I want to move towards an
accessible site that will display forms in the right order without
CSS.
Regards, Chris.
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top