This question is locked. New answers and comments are not allowed.
Hi,
I have a very simple RadGrid:
<telerik:RadGrid ID="RadGrid1" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource"
GridLines="None" AutoGenerateColumns="true">
</telerik:RadGrid>
And some code for binding the grid:
protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
IObjectScope scope = ORMObjectScopeProvider.ObjectScope();
IQueryResult clist = scope.GetOqlQuery("select * from OrderExtent as x").Execute();
RadGrid1.DataSource = clist;
}
It produces the following error message:
Telerik.OpenAccess.Exceptions.InvalidOperationException: Any operation that will fully resolve the query may not be called once a 'get' operation was performed
After I insert the instruction:
int i = clist.Count;
just before "RadGrid1.DataSource = clist;" it starts to work well.
Is it a known workaround of a known problem? And this is why there is a similar "unnecessary" code in your demos?
Regards
Tomasz
I have a very simple RadGrid:
<telerik:RadGrid ID="RadGrid1" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource"
GridLines="None" AutoGenerateColumns="true">
</telerik:RadGrid>
And some code for binding the grid:
protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
IObjectScope scope = ORMObjectScopeProvider.ObjectScope();
IQueryResult clist = scope.GetOqlQuery("select * from OrderExtent as x").Execute();
RadGrid1.DataSource = clist;
}
It produces the following error message:
Telerik.OpenAccess.Exceptions.InvalidOperationException: Any operation that will fully resolve the query may not be called once a 'get' operation was performed
After I insert the instruction:
int i = clist.Count;
just before "RadGrid1.DataSource = clist;" it starts to work well.
Is it a known workaround of a known problem? And this is why there is a similar "unnecessary" code in your demos?
Regards
Tomasz