Retrieving text from DataList cells

S

Stephan Bour

I need to build a string from the content of a datalist containing a nested
datagrid.
This properly returns the data from the first cell in the datagrid:
String first = GridItem.Cells[0].Text;

However, I can't seem to apply the same technique to the datalist as ³Cells²
is not implemented. How does one retrieve the text from a datalist cell
then?
Thanks,
Stephan.
 
B

Bin Song

If you know it is the first control in the list, you could:
CType(e.item.Controls(0), TextBox).Text()
or loop through all controls
Dim i As Integer
For i = 0 To e.Item.Controls.Count - 1
If TypeOf e.Item.Controls(i) Is Textbox Then
CType(e.item.Controls(i), TextBox).Text()
End If
Next

Bin Song, MCP
 

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,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top