Wednesday, March 28, 2012

TableCell

I create a TableCell by

TableCell cell = new TableCell()

but I could not find how to add a TextBox inside this cell. Any ideas?

Thanks in advance
Serdar KALAYCI
--WebControls.TextBox txt = new WebControls.TextBox();
cell.Controls.Add(txt);

Karl

"Serdar Kalayc" <serdarkalayci@.unisec.com.tr> wrote in message
news:ewP%23cXwPDHA.4024@.tk2msftngp13.phx.gbl...
> I create a TableCell by
> TableCell cell = new TableCell()
> but I could not find how to add a TextBox inside this cell. Any ideas?
> Thanks in advance
> Serdar KALAYCI
> --
Got it, here's the code if anyone wonders...

TableCell cell = new TableCell();
TextBox text1 = new TextBox();
cell.Controls.Add (text1);

"Serdar Kalayc" <serdarkalayci@.unisec.com.tr> wrote in message
news:ewP#cXwPDHA.4024@.tk2msftngp13.phx.gbl...
> I create a TableCell by
> TableCell cell = new TableCell()
> but I could not find how to add a TextBox inside this cell. Any ideas?
> Thanks in advance
> Serdar KALAYCI
> --
I have one more question. I added a Button inside a Table at design time by
changing HTML codes, but I can't access it's events or even see it in the
components list on the Properties window.

Serdar KALAYCI

"Karl Seguin" <kseguin##crea.ca> wrote in message
news:uO53SbwPDHA.1608@.TK2MSFTNGP11.phx.gbl...
> WebControls.TextBox txt = new WebControls.TextBox();
> cell.Controls.Add(txt);
> Karl
>
> "Serdar Kalayc" <serdarkalayci@.unisec.com.tr> wrote in message
> news:ewP%23cXwPDHA.4024@.tk2msftngp13.phx.gbl...
> > I create a TableCell by
> > TableCell cell = new TableCell()
> > but I could not find how to add a TextBox inside this cell. Any ideas?
> > Thanks in advance
> > Serdar KALAYCI
> > --
if you are adding an object programatically, like your butotn, you'll also
have to attach the event programatically.

in vb.net, you can use:
addhandler yourButton.click, AddressOf yourFunctionHandler

in c#, you can use:
yourButton.Click += new EventHandler(yourFunctionHandler);

Make sure that your button is created, and you attach your handler on
postback also (ie, don't wrap it in an !page.IsPostback)

Karl

"Serdar Kalayc" <serdarkalayci@.unisec.com.tr> wrote in message
news:ulgu2oxPDHA.1748@.TK2MSFTNGP11.phx.gbl...
> I have one more question. I added a Button inside a Table at design time
by
> changing HTML codes, but I can't access it's events or even see it in the
> components list on the Properties window.
> Serdar KALAYCI
>
> "Karl Seguin" <kseguin##crea.ca> wrote in message
> news:uO53SbwPDHA.1608@.TK2MSFTNGP11.phx.gbl...
> > WebControls.TextBox txt = new WebControls.TextBox();
> > cell.Controls.Add(txt);
> > Karl
> > "Serdar Kalayc" <serdarkalayci@.unisec.com.tr> wrote in message
> > news:ewP%23cXwPDHA.4024@.tk2msftngp13.phx.gbl...
> > > I create a TableCell by
> > > > TableCell cell = new TableCell()
> > > > but I could not find how to add a TextBox inside this cell. Any ideas?
> > > > Thanks in advance
> > > Serdar KALAYCI
> > > --
> > >

0 comments:

Post a Comment