binding a Generic.List to a repeater

  • Thread starter Thread starter DotNetNewbie
  • Start date Start date
D

DotNetNewbie

Hi,

It is not possible to bind a Generic.List collection to a repeater I
guess huh?

I am getting this error:

An invalid data source is being used for rpCategories. A valid data
source must implement either IListSource or IEnumerable.


Is this correct or could I be doing something else wrong?
 
List<T> or List(of T) has a ToArray method. You could bind to the output of
that method call to your repeater.

Mark Dykun
 
This seems a little strange to me, as IList<T> extends IEnumerable<T>,
which extends IEnumerable, so the error message must be wrong (or you are
not passing what you think is an IList<T> implementation).
 
This seems a little strange to me, as IList<T> extends IEnumerable<T>,
which extends IEnumerable, so the error message must be wrong (or you are
not passing what you think is an IList<T> implementation).

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)


It is not possible to bind a Generic.List collection to a repeater I
guess huh?
I am getting this error:
An invalid data source is being used for rpCategories. A valid data
source must implement either IListSource or IEnumerable.
Is this correct or could I be doing something else wrong?

Yeah something else has to be wrong.

I changed the collection to an ArrayList and I still get the same
error.
 
Yeah something else has to be wrong.

I changed the collection to an ArrayList and I still get the same
error.

Ok this is what happend:

I named my List<T> collection rgSomething.

And my repeater was rpSomething.

And I was binding like so:

rpSomething.DataSource = rpSomething;

==> I was binding a repeater to a repeater!!
 
Ah, there's the rub

Mark

DotNetNewbie said:
Ok this is what happend:

I named my List<T> collection rgSomething.

And my repeater was rpSomething.

And I was binding like so:

rpSomething.DataSource = rpSomething;

==> I was binding a repeater to a repeater!!
 

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

Back
Top