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:
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.
[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.
Hi Bomlin,
<ErrorTemplate>No data</ErrorTemplate>
In the meantime we'll research and fix that issue. Thanks for reprting it!
<ig:WebDataGrid ID="UI_grdMemos" runat="server"
Width="800px"
style="margin-right: 1px">
<EmptyRowsTemplate>
No rows found
</EmptyRowsTemplate>
<ErrorTemplate>
</ErrorTemplate>
<Behaviors>
<ig:RowSelectors>
</ig:RowSelectors>
ColumnSelectType="Multiple" RowSelectType="Single">
</ig:Selection>
<ig:Sorting Enabled="true" SortingMode="Single"></ig:Sorting>
<ig:ColumnResizing>
</ig:ColumnResizing>
<ig:Filtering>
</ig:Filtering>
</Behaviors>
<Columns>
<ig:BoundDataField DataFieldName="Id" Key="Id" Width="70px">
<Header Text="Memo ID" />
</ig:BoundDataField>
<ig:BoundDataField DataFieldName="Title" Key="Title" Width="250px">
<Header Text="Title" />
<ig:BoundDataField DataFieldName="CurrentUserName" Key="CurrentUserName">
<Header Text="Current User" />
<ig:BoundDataField DataFieldName="LastUpdate" Key="LastUpdate">
<Header Text="LastUpdate" />
<ig:BoundDataField DataFieldName="Status" Key="Status">
<Header Text="Status" />
<ig:BoundDataField DataFieldName="Priority" Key="Priority">
<Header Text="Priority" />
</Columns>
</ig:WebDataGrid>