Accesing textboxs inside a table.

  • Thread starter Thread starter Slim
  • Start date Start date
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?
 
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?
 
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?
 
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?
 
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?
 
You need to typecast customerLastSales.Rows(i).Cells(j).Controls(0) to a
textbox.
 
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

Back
Top