Retrieving text from DataList cells

  • Thread starter Thread starter Stephan Bour
  • Start date Start date
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.
 
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
 
Back
Top