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.

ASP.NET MVC Grid and EntityFramework support

Thread ID:

Created:

Updated:

Platform:

Replies:

89643 Sep 1,2009 03:59 AM Sep 2,2009 02:48 AM ASP.NET MVC (Classic) 2
loading
Tags: Grid
Cengiz Han
Asked On September 1, 2009 03:59 AM

When I am binding a EntityCollection object to the grid, it gives the invalidcastexception

LicenseInfo object contains LicenseInfoAppServerInfo object.

and I have linq query runs over entity framework.

var licenses = from lc in context.LICENSE_INFO
where lc.Customer.Id == id
select lc;
GridPropertiesModel gridModel = new GridPropertiesModel()
{
DataSource = licenses
};
ViewData["GridModel"] = gridModel;

Unable to cast object of type 'System.Data.Objects.DataClasses.EntityCollection`1[Licensing.Model.LicenseAppServerInfo]' to type 'System.Collections.IList'.

I don't want to create any other custom object like dto.

Balaji M [Syncfusion]
Replied On September 1, 2009 10:41 AM

Hi Cengiz,

Thank you for your interest in syncfusion products.

I am afraid that I am unable to reproduce the reported issue. I have created a simple sample to test this issue and I am able to bind the EntityCollection object to Grid successfully and the sample is available from below link.

http://files.syncfusion.com/support/grid_mvc/Incidents/F89643/MvcSample.zip

Please have a look at the above sample and if still the issue exists, could you please try reproducing it in the above sample and send us the modified sample so that we could sort out the cause of the issue and provide you a solution?.

Please let me know if you have any concerns.

Regards,
M.Balaji.

Balaji M [Syncfusion]
Replied On September 2, 2009 02:48 AM

Hi Cengiz,

Thank you for your interest in syncfusion products.

I am afraid that I am unable to reproduce the reported issue. I have created a simple sample to test this issue and I am able to bind the EntityCollection object to Grid successfully and the sample is available from below link.

http://files.syncfusion.com/support/grid_mvc/Incidents/F89643/MvcSample.zip

Please have a look at the above sample and if still the issue exists, could you please try reproducing it in the above sample and send us the modified sample so that we could sort out the cause of the issue and provide you a solution?.

Please let me know if you have any concerns.

Regards,
M.Balaji.

===================================================================================================

“We have also created a support incident for you under your Direct Trac customer account for this issue, because with Direct Trac, you have access to an assigned engineer who will guide you until this issue is resolved to your satisfaction. You will also be able to take advantage of other customer empowering features like the “Escalate” option and the email alerts that are sent to you when we update the incident.. Please try logging in to Direct Trac from the following location and explore its features and benefits:

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents

===================================================================================================

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.

;