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é
Please submit a bug for that issue and we'll do our best to fix it ASAP.
If you move the code to a separate method you can return just IQueryable instead of IQueryable<PrioritiesAccommodations>.
I don't know if you already found a solution , but I just had the same problem.When the datasource is a list of anonymous type, all works well, but when you define a class for the collection,I get that message.In my case the class was defined using public fields only, and that was the problem, as soon as I added properties for the class, the problem was gone.ExampleOriginal class Not working:
Class Cls1{ Public String Field1; ...................}Modified Class Working:
Class Cls1{ Public String Field1{get;set;}}I hope this helps.
I am binding my Object datasource to the webdatagrid in the aspx page and the object data source retrieves an object filled with data and it has all public properties in it and I get the error:
Can you please suggest a solution for it?
I am using Version=10.3.20103.2164
Sorry, but I can't.
When I got that error, it was because my class had public fields and not public properties. When I added the public properties the problem was gone.
If you already have public properties, I don't know what could be happening.
Regards,
Gustavo