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.
Unfortunately, activation email could not send to your email. Please try again.

Cannot bind to a IList collection

Thread ID:

Created:

Updated:

Platform:

Replies:

73732 May 15,2008 08:42 PM May 29,2008 08:14 AM ASP.NET Web Forms (Classic) 3
loading
Tags: GridGroupingControl
Dave Sanders
Asked On May 15, 2008 08:42 PM

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?


Janagan [Syncfusion]
Replied On May 19, 2008 10:08 AM

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.



Dave Sanders
Replied On May 20, 2008 05:00 PM

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.



Rajarajeswari S [Syncfusion]
Replied On May 29, 2008 08:14 AM


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



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;