DataBound DataList showing the correct number of empty elements!

  • Thread starter Thread starter Luis Ferrao
  • Start date Start date
L

Luis Ferrao

Hi, i'm experiencing strange problems with the datalist webcontrol.

I have it bound to a datatable like this:

Me.TreeNodeList.DataSource = _existingNodesTable
Me.TreeNodeList.DataBind()

which does contain the elements i want to display. The problem is that
the final output looks like this:

<table ...>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
...
</table>

Actually the number of lines is the same as the number of records in the
datatable, but they're all empty!

Thanks in advance for any help!

Luis
 
Luis,

A datalist has to have an item template. Do you have one? What is there?

If all you want is just to show the table as it is you should use a datagrid
wth AutoGenerateColumns=true, which is default.

Eliyahu
 
Back
Top