Good day,
I get a "datasource contains no schema data" error on my 2010v2 webdatagrid. The biggest problem is that i do have data in the datasource. I have the following errorStackTrace:
[NotSupportedException: Data source contains no schema data.] Infragistics.Web.UI.GridControls.WebDataGrid.CopyFields() +819 Infragistics.Web.UI.GridControls.WebDataGrid.FillFields() +195 Infragistics.Web.UI.GridControls.WebDataGrid.DataBind() +834 GoGoYield.Website_priorities.ShowPrioritiesTab() in D:\ReneM\Perforce\ReneM-Sundio\Logistiek\LC\Sundio MT\Development\V4_0\Application\GogoYield\Website_priorities_priorities.cs:237 GoGoYield.Website_priorities.Page_LoadComplete(Object sender, EventArgs e) in D:\ReneM\Perforce\ReneM-Sundio\Logistiek\LC\Sundio MT\Development\V4_0\Application\GogoYield\Website_priorities.aspx.cs:86 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35 System.EventHandler.Invoke(Object sender, EventArgs e) +0 System.Web.UI.Page.OnLoadComplete(EventArgs e) +8872202 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2350
The data in the datasource exists of:
var priorities = from accommodationPrio in entities.AccommodationPrios where accommodationPrio.BrandId == intBrandId join accommodation in entities.Accommodations on accommodationPrio.AccommodationId equals accommodation.AccommodationId select new PrioritiesAccommodations { Priority = accommodationPrio.Priority , BrandId = accommodationPrio.BrandId , AccommodationName = accommodation.AccommodationName , CountryId = accommodation.CountryId , RegionId = accommodation.RegionId , DestinationId = accommodation.DestinationId };
wdgPriorities.ClearDataSource();
wdgPriorities.DataSource = priorities;
wdgPriorities.DataBind();
Any ideas of what is wrong here?
Hi,
You can submit a bug for that issue.
Do you have autogenerateColumns set to true? If so try to define the columns manually and turn-off AutoGenerateColumns.
I already set autogenerate to false and define the columns manually. I can now see where it goes wrong:
IQueryable<PrioritiesAccommodations> priorities = from accommodationPrio in entities.AccommodationPrios where accommodationPrio.BrandId == (int)intBrandId join accommodation in entities.Accommodations on accommodationPrio.AccommodationId equals accommodation.AccommodationId join accommodationClassGroup in entities.AccommodationClassGroups on accommodation.AccommodationClassGroupId equals accommodationClassGroup.AccommodationClassGroupId join countryRegionDestination in entities.CountryRegionDestinations on new {accommodation.CountryId, accommodation.RegionId, accommodation.DestinationId} equals new {countryRegionDestination.CountryId, countryRegionDestination.RegionId, countryRegionDestination.DestinationId} select new PrioritiesAccommodations { Priority = accommodationPrio.Priority , PriorityOverrule = accommodationPrio.PriorityOverrule , BrandId = accommodationPrio.BrandId , AccommodationName = accommodation.AccommodationName , CountryId = accommodation.CountryId , RegionId = accommodation.RegionId , DestinationId = accommodation.DestinationId , AccommodationClassGroupId = accommodation.AccommodationClassGroupId , AccommodationClass = accommodationClassGroup.Name , Country = countryRegionDestination.CountryName , Region = countryRegionDestination.RegionName , Destination = countryRegionDestination.DestinationName } ;
If I remove the bold code and change the type of priorities to var, then it works. But........ I want this code in a seperate function which, unfortunately, can not return a var variable.
Any idea?
regards,
René