Groups | Blog | Home
all groups > asp.net > february 2005 >

asp.net : DataBound DataList showing the correct number of empty elements!



Luis Ferrao
2/15/2005 11:42:39 PM
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

*** Sent via Developersdex http://www.developersdex.com ***
Eliyahu Goldin
2/16/2005 10:39:10 AM
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

[quoted text, click to view]

AddThis Social Bookmark Button