Home All Groups Group Topic Archive Search About
Author
16 Mar 2006 3:50 PM
sameer
Guys , this is an easy one for you pros out their,

i am trying to creating dynamic controls in asp.net, i use a placeholder
control and create all the text boxes and label in it and it does it pretty
good, but the problems is that all the controls are created in a horizonatal
way i.e right next to each other, if i have 10 controls all of them are
created right next to each other, but i want to create them in vertical style
so that i have 3 controls each (out of 12) in a rows, and have 4 rows, is
their any way that you kow of to do it? do i have to use a TABLE?

let me know thanks

Author
16 Mar 2006 4:00 PM
Phillip Williams
If the controls are of the same type, you may use the DataList to render them
in a table layout by setting the datalist's properties: RepeatLayout= Table
and RepeatColumns =3 http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.datalist_properties(VS.80).aspx
Show quoteHide quote
"sameer" wrote:

> Guys , this is an easy one for you pros out their,
>
> i am trying to creating dynamic controls in asp.net, i use a placeholder
> control and create all the text boxes and label in it and it does it pretty
> good, but the problems is that all the controls are created in a horizonatal
> way i.e right next to each other, if i have 10 controls all of them are
> created right next to each other, but i want to create them in vertical style
> so that i have 3 controls each (out of 12) in a rows, and have 4 rows, is
> their any way that you kow of to do it? do i have to use a TABLE?
>
> let me know thanks
Author
16 Mar 2006 5:19 PM
sameer
Philips, thanks for your help i am now done withthat part, i used a
placeholder( not creating it dyamically but adding it manullay to the
webform)  and create a table in it and the added controls to it;s rows, works
pretty well. but now i am stuck with another issue, These dynamic text boxes
have values in them, when i hit on Submit and in the Submit event of the
button when i check the placeholder it does not have those values any more!!
aggravation, right when i thought i was all done, so now the questions is how
can i get the values from the dynamicall created text boxes?

thanks, waiting on your reply.
Sameer

Show quoteHide quote
"Phillip Williams" wrote:

> If the controls are of the same type, you may use the DataList to render them
> in a table layout by setting the datalist's properties: RepeatLayout= Table
> and RepeatColumns =3
> http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.datalist_properties(VS.80).aspx
> --
> HTH,
> Phillip Williams
> http://www.societopia.net
> http://www.webswapp.com
>
>
> "sameer" wrote:
>
> > Guys , this is an easy one for you pros out their,
> >
> > i am trying to creating dynamic controls in asp.net, i use a placeholder
> > control and create all the text boxes and label in it and it does it pretty
> > good, but the problems is that all the controls are created in a horizonatal
> > way i.e right next to each other, if i have 10 controls all of them are
> > created right next to each other, but i want to create them in vertical style
> > so that i have 3 controls each (out of 12) in a rows, and have 4 rows, is
> > their any way that you kow of to do it? do i have to use a TABLE?
> >
> > let me know thanks
Author
16 Mar 2006 5:30 PM
Phillip Williams
1- Make sure you added those controls to the placeholder during the page
initialization stage of every postback.

2- Make sure you gave each a unique ID, e.g. TextBox1.Id="TextBox1".  (This
would have been done automatically for you had you used the datalist instead
of a place holder)

3- Use the FindControl method on the container object to get a reference to
each control by its ID (had you used the datalist you would have looped
through its ListItems and called the ListItem.FindControl method)

Show quoteHide quote
"sameer" wrote:

> Philips, thanks for your help i am now done withthat part, i used a
> placeholder( not creating it dyamically but adding it manullay to the
> webform)  and create a table in it and the added controls to it;s rows, works
> pretty well. but now i am stuck with another issue, These dynamic text boxes
> have values in them, when i hit on Submit and in the Submit event of the
> button when i check the placeholder it does not have those values any more!!
> aggravation, right when i thought i was all done, so now the questions is how
> can i get the values from the dynamicall created text boxes?
>
> thanks, waiting on your reply.
> Sameer
>
> "Phillip Williams" wrote:
>
> > If the controls are of the same type, you may use the DataList to render them
> > in a table layout by setting the datalist's properties: RepeatLayout= Table
> > and RepeatColumns =3
> > http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.datalist_properties(VS.80).aspx
> > --
> > HTH,
> > Phillip Williams
> > http://www.societopia.net
> > http://www.webswapp.com
> >
> >
> > "sameer" wrote:
> >
> > > Guys , this is an easy one for you pros out their,
> > >
> > > i am trying to creating dynamic controls in asp.net, i use a placeholder
> > > control and create all the text boxes and label in it and it does it pretty
> > > good, but the problems is that all the controls are created in a horizonatal
> > > way i.e right next to each other, if i have 10 controls all of them are
> > > created right next to each other, but i want to create them in vertical style
> > > so that i have 3 controls each (out of 12) in a rows, and have 4 rows, is
> > > their any way that you kow of to do it? do i have to use a TABLE?
> > >
> > > let me know thanks
Author
16 Mar 2006 7:39 PM
sameer
thanks Philip, did the trick.

Show quoteHide quote
"Phillip Williams" wrote:

> 1- Make sure you added those controls to the placeholder during the page
> initialization stage of every postback.
>
> 2- Make sure you gave each a unique ID, e.g. TextBox1.Id="TextBox1".  (This
> would have been done automatically for you had you used the datalist instead
> of a place holder)
>
> 3- Use the FindControl method on the container object to get a reference to
> each control by its ID (had you used the datalist you would have looped
> through its ListItems and called the ListItem.FindControl method)
>
> --
> HTH,
> Phillip Williams
> http://www.societopia.net
> http://www.webswapp.com
>
>
> "sameer" wrote:
>
> > Philips, thanks for your help i am now done withthat part, i used a
> > placeholder( not creating it dyamically but adding it manullay to the
> > webform)  and create a table in it and the added controls to it;s rows, works
> > pretty well. but now i am stuck with another issue, These dynamic text boxes
> > have values in them, when i hit on Submit and in the Submit event of the
> > button when i check the placeholder it does not have those values any more!!
> > aggravation, right when i thought i was all done, so now the questions is how
> > can i get the values from the dynamicall created text boxes?
> >
> > thanks, waiting on your reply.
> > Sameer
> >
> > "Phillip Williams" wrote:
> >
> > > If the controls are of the same type, you may use the DataList to render them
> > > in a table layout by setting the datalist's properties: RepeatLayout= Table
> > > and RepeatColumns =3
> > > http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.datalist_properties(VS.80).aspx
> > > --
> > > HTH,
> > > Phillip Williams
> > > http://www.societopia.net
> > > http://www.webswapp.com
> > >
> > >
> > > "sameer" wrote:
> > >
> > > > Guys , this is an easy one for you pros out their,
> > > >
> > > > i am trying to creating dynamic controls in asp.net, i use a placeholder
> > > > control and create all the text boxes and label in it and it does it pretty
> > > > good, but the problems is that all the controls are created in a horizonatal
> > > > way i.e right next to each other, if i have 10 controls all of them are
> > > > created right next to each other, but i want to create them in vertical style
> > > > so that i have 3 controls each (out of 12) in a rows, and have 4 rows, is
> > > > their any way that you kow of to do it? do i have to use a TABLE?
> > > >
> > > > let me know thanks