Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
220
Cannot bind to an empty custom collection.
posted

  I have a custom business object that inherits from List<t> that I am binding to using ObjectDataSource.  It works great when there is data present.  However, if there is no data returned, I get the following error:

Data source contains no schema data.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NotSupportedException: Data source contains no schema data.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[NotSupportedException: Data source contains no schema data.]
   Infragistics.Web.UI.GridControls.WebDataGrid.DataBind() +678
   System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
   Infragistics.Web.UI.Framework.Data.FlatDataBoundControl.EnsureDataBound() +84
   Infragistics.Web.UI.GridControls.WebDataGrid.EnsureDataBound() +168
   Infragistics.Web.UI.GridControls.WebDataGrid.CreateChildControls() +43
   System.Web.UI.Control.EnsureChildControls() +87
   Infragistics.Web.UI.GridControls.WebDataGrid.EnsureChildControls() +113
   System.Web.UI.Control.PreRenderRecursiveInternal() +44
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842

 

I am completely stuck on this one.  Any help would be greatly appreciated.

Parents
  • 3147
    posted

    Hi Bomlin,

    For now you can add an error template to WebDataGrid as a workaround, for example:

    <ErrorTemplate>No data</ErrorTemplate>

    In the meantime we'll research and fix that issue. Thanks for reprting it!

Reply Children