'IListSource does not contain any data sources'

P

peter

Hi,

I try to bind a DataTable to a DataGrid, but I receive
the following error-message :
'The IListSource does not contain any data sources'.

I have no clue what the problem might be, as I can tell that
the DataTable actually contains valid data. This is the code :


DataTable dtUserlist = new CoreTasks().selectUsers();

showContent(dtUserlist); // Proves that the DataTable contains data.

dgTasks.DataSource = dtUserlist;
dgTasks.DataBind(); // Error on this line.

I have already searched a lot on this, but to no avail.
Who can point me in the right direction ?
 
M

Marina

Do you have any code that happens on databinding, etc.

Does this work on just a plain grid with nothing customized?
 
R

raymond

I try to bind a DataTable to a DataGrid, but I receive
Does this work on just a plain grid with nothing customized?

I will try that.

Do you have any code that happens on databinding, etc.

I don't understand what you mean by that. As you can see in my code
snippet, I have a class which provides a filled DataTable, just before
I try to bind it.

The test-method 'showContent(dtUserlist)' proves that the DataTable
really contains data, so how could the data-binding possible fail ?

I have several other similair DataGrids in my project, they all work fine.
The only difference here is, that this DataGrid is in a modal dialog. But it
has worked before. I think the problem has started when I moved the
code which fills the table to its own class.
But (and I start to repeat myself :), the DataTable really contains
data, so how on earth could the data-binding possible fail ?

Peter.
 

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,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top