We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Cannot bind to a IList collection

I'm not sure what I'm doing wrong, but I have a very basic grid set up, with two columns defined, both of which map to public properties on my objects contained within an IList. Whenever I try to set the datasource of the grid to my list, I get this error:

"A list corresponding to the selected DataMember was not found"

What does this error mean, and can you give me an example for attaching to an IList?


3 Replies

JA Janagan Syncfusion Team May 19, 2008 02:08 PM UTC

Hi Dave,

Thanks for your interest in Syncfusion products.

You can bind the Grid with the Ilist. Please refer the sample in the link below:

http://websamples.syncfusion.com/samples/Grid.Web/6.2.0.40/Grid_ASP_Ilist/main.htm


Please try running the sample and let me know if this helps.

Thanks,
Janagan.




DS Dave Sanders May 20, 2008 09:00 PM UTC

Well, I found I could get it to work if I changed my collection. I have a collection object that uses:

CollectionBase, ITypedList, IBindingList, IList, ICollection, IEnumerable

If I try to bind that to the grid, I get this error:

A list corresponding to the selected DataMember was not found.

If I iterate through my collection and copy all of the items over to a type of IList<>, I can bind it without an error.

I'll go about doing it this way, but just figured I'd bring it up.




RS Rajarajeswari S Syncfusion Team May 29, 2008 12:14 PM UTC


Hi Dave,

Thanks for your interest in Syncfusion products.

I am afraid that I am not able to reproduce the issues, you have mentioned here. Please refer the following steps, that I tried to reproduce it:

1.Created a sample with GGC.
2.Binded it with Collection object
3.It doesn’t throw any exception.

When GGC is binded with Collection object no need to set the DataMember property, It is not needed with Collection object.

I have created a simple sample illustrating the above:

http://websamples.syncfusion.com/samples/Grid.Web/6.2.0.40/Grid_ASP_CollectionObject/main.htm


Please have a look at the above sample and if still the issue exists, Could you please try reproducing it in the above sample? So that we could sort out the cause of the issue very fast and provide you a better solution.

Regards,
Raji



Loader.
Live Chat Icon For mobile
Up arrow icon