Accesing textboxs inside a table.

S

Slim

Accessing textboxes inside a table.

I am trying to access controls in a table like this
customerLastSales.Rows(i).Cells(j).Controls(0)

but asp.net says
customerLastSales.Rows(i).Cells(j).Controls(0) does not have property called
text.

How can I them with out knowing their individual ID's?
 
S

Slim

I tried this,

dim tb as Textbox
tb = customerLastSales.Rows(i).Cells(j).Controls(0)

xxx = tb.text

but did not work

Ok just occurred to me you mean like this


dim tb as Textbox
tb = cType( customerLastSales.Rows(i).Cells(j).Controls(0),textbox)
xxx = tb.text

I will give that a try at work Wednesday


Eliyahu Goldin said:
You need to typecast customerLastSales.Rows(i).Cells(j).Controls(0) to a
textbox.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

Slim said:
Accessing textboxes inside a table.

I am trying to access controls in a table like this
customerLastSales.Rows(i).Cells(j).Controls(0)

but asp.net says
customerLastSales.Rows(i).Cells(j).Controls(0) does not have property
called text.

How can I them with out knowing their individual ID's?
 
S

Slim

made a demo, it worked fine

Eliyahu Goldin said:
Yes, something like this. I am not with vb, so I can't confirm the exact
syntax.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

Slim said:
I tried this,

dim tb as Textbox
tb = customerLastSales.Rows(i).Cells(j).Controls(0)

xxx = tb.text

but did not work

Ok just occurred to me you mean like this


dim tb as Textbox
tb = cType( customerLastSales.Rows(i).Cells(j).Controls(0),textbox)
xxx = tb.text

I will give that a try at work Wednesday


Eliyahu Goldin said:
You need to typecast customerLastSales.Rows(i).Cells(j).Controls(0) to a
textbox.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

Accessing textboxes inside a table.

I am trying to access controls in a table like this
customerLastSales.Rows(i).Cells(j).Controls(0)

but asp.net says
customerLastSales.Rows(i).Cells(j).Controls(0) does not have property
called text.

How can I them with out knowing their individual ID's?
 
S

Slim

Slim said:
made a demo, it worked fine

Eliyahu Goldin said:
Yes, something like this. I am not with vb, so I can't confirm the exact
syntax.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

Slim said:
I tried this,

dim tb as Textbox
tb = customerLastSales.Rows(i).Cells(j).Controls(0)

xxx = tb.text

but did not work

Ok just occurred to me you mean like this


dim tb as Textbox
tb = cType( customerLastSales.Rows(i).Cells(j).Controls(0),textbox)
xxx = tb.text

I will give that a try at work Wednesday


You need to typecast customerLastSales.Rows(i).Cells(j).Controls(0) to
a textbox.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

Accessing textboxes inside a table.

I am trying to access controls in a table like this
customerLastSales.Rows(i).Cells(j).Controls(0)

but asp.net says
customerLastSales.Rows(i).Cells(j).Controls(0) does not have property
called text.

How can I them with out knowing their individual ID's?
 
S

Slim

thanks

Slim said:
made a demo, it worked fine

Eliyahu Goldin said:
Yes, something like this. I am not with vb, so I can't confirm the exact
syntax.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

Slim said:
I tried this,

dim tb as Textbox
tb = customerLastSales.Rows(i).Cells(j).Controls(0)

xxx = tb.text

but did not work

Ok just occurred to me you mean like this


dim tb as Textbox
tb = cType( customerLastSales.Rows(i).Cells(j).Controls(0),textbox)
xxx = tb.text

I will give that a try at work Wednesday


You need to typecast customerLastSales.Rows(i).Cells(j).Controls(0) to
a textbox.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

Accessing textboxes inside a table.

I am trying to access controls in a table like this
customerLastSales.Rows(i).Cells(j).Controls(0)

but asp.net says
customerLastSales.Rows(i).Cells(j).Controls(0) does not have property
called text.

How can I them with out knowing their individual ID's?
 
E

Eliyahu Goldin

You need to typecast customerLastSales.Rows(i).Cells(j).Controls(0) to a
textbox.
 
E

Eliyahu Goldin

Yes, something like this. I am not with vb, so I can't confirm the exact
syntax.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

Slim said:
I tried this,

dim tb as Textbox
tb = customerLastSales.Rows(i).Cells(j).Controls(0)

xxx = tb.text

but did not work

Ok just occurred to me you mean like this


dim tb as Textbox
tb = cType( customerLastSales.Rows(i).Cells(j).Controls(0),textbox)
xxx = tb.text

I will give that a try at work Wednesday


Eliyahu Goldin said:
You need to typecast customerLastSales.Rows(i).Cells(j).Controls(0) to a
textbox.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

Slim said:
Accessing textboxes inside a table.

I am trying to access controls in a table like this
customerLastSales.Rows(i).Cells(j).Controls(0)

but asp.net says
customerLastSales.Rows(i).Cells(j).Controls(0) does not have property
called text.

How can I them with out knowing their individual ID's?
 

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

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top