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.
In which version it is fixed? I'm using the laitest version, 2008v3 .NET 3.5 with new Aikido CTP. And I'm experiencing the same problem basically, but I'm not sure if this is related to the same bug though.
In my case, when data source returns zero rows, the exception is thrown declaring that DataKeyField is invalid.
I'm using the latest WebDataGrid and ObjectDataSource as it's data source. ObjectDataSource returns simple IEnumerable<T> of objects. I have disabled AutoGenerateColumns and manually added only one column. DataKeyField is also specified.
Hi again,
The bug is resolved and the WebDataGrid will handle empty collections correctly in the next release.
Excuse us for the inconvenience and I hope you'll have great experience with our new grid in the future!
Thanks for the code sample, I was able to reproduce the issue and I'm working on resolving 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>
Hi Bomlin,
<ErrorTemplate>No data</ErrorTemplate>
In the meantime we'll research and fix that issue. Thanks for reprting it!