DataBound DataList showing the correct number of empty elements!

Discussion in 'ASP .Net' started by Luis Ferrao, Feb 16, 2005.

  1. Luis Ferrao

    Luis Ferrao Guest

    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 ***
    Don't just participate in USENET...get rewarded for it!
    Luis Ferrao, Feb 16, 2005
    #1
    1. Advertising

  2. 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

    "Luis Ferrao" <> wrote in message
    news:euQXYs$...
    > 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 ***
    > Don't just participate in USENET...get rewarded for it!
    Eliyahu Goldin, Feb 16, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steve
    Replies:
    0
    Views:
    3,044
    Steve
    Feb 1, 2005
  2. Lukas
    Replies:
    3
    Views:
    790
    spiff
    Nov 10, 2005
  3. rodchar
    Replies:
    0
    Views:
    384
    rodchar
    Nov 26, 2007
  4. Manu
    Replies:
    0
    Views:
    161
  5. froil
    Replies:
    12
    Views:
    304
    Gunnar Hjalmarsson
    Mar 2, 2006
Loading...

Share This Page