StrataFrame Forum

WebBusinessBindingSource binding to RadGrid

http://forum.strataframe.net/Topic24230.aspx

By Govinda Berrio - 8/18/2009

After installing the 1.6.7 update from 1.6.6 I'm now getting this exception when using WebBusinessBindingSource with a RadGrid
By Govinda Berrio - 8/18/2009

the exception:

Exception Details: System.InvalidOperationException: This is a single-use enumerator and cannot be reset.



MicroFour.StrataFrame.Business.Enumerator.MoveNext() +130

MicroFour.StrataFrame.UI.Web.Enumerator.MoveNext() +95

Telerik.Web.UI.AdvancedEnumerator.MoveNext() +40

Telerik.Web.UI.GetEnumerator>d__0.MoveNext() +95

Telerik.Web.UI.GridDataTableFromEnumerable.FillDataTableFromEnumerable(IQueryable enumerable) +176

Telerik.Web.UI.GridDataTableFromEnumerable.FillData35() +3871

Telerik.Web.UI.GridDataTableFromEnumerable.FillData() +626

Telerik.Web.UI.GridResolveEnumerable.Initialize() +32

Telerik.Web.UI.GridResolveEnumerable.EnsureInitialized() +20

Telerik.Web.UI.GridEnumerableFromDataView..ctor(GridTableView owner, IEnumerable enumerable, Boolean CaseSensitive, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields) +149

Telerik.Web.UI.GridDataSourceHelper.CreateGridEnumerable(GridTableView owner, IEnumerable enumerable, Boolean caseSensitive, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields) +129

Telerik.Web.UI.GridDataSourceHelper.GetResolvedDataSource(GridTableView owner, Object dataSource, String dataMember, Boolean caseSensitive, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields) +383

Telerik.Web.UI.GridTableView.get_ResolvedDataSource() +141

Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) +46

Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) +491

System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +57

System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +114

System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +31

MicroFour.StrataFrame.UI.Web.WebBusinessBindingSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +8

System.Web.UI.WebControls.DataBoundControl.PerformSelect() +142

Telerik.Web.UI.GridTableView.PerformSelect() +4

System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73

Telerik.Web.UI.GridTableView.DataBind() +239

System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82

Telerik.Web.UI.RadGrid.DataBind() +58

System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82

System.Web.UI.WebControls.BaseDataBoundControl.OnPreRender(EventArgs e) +22

Telerik.Web.UI.RadCompositeDataBoundControl.OnPreRender(EventArgs e) +12

Telerik.Web.UI.RadGrid.OnPreRender(EventArgs e) +28

System.Web.UI.Control.PreRenderRecursiveInternal() +80

System.Web.UI.Control.PreRenderRecursiveInternal() +171

System.Web.UI.Control.PreRenderRecursiveInternal() +171

System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842
By Trent L. Taylor - 8/18/2009

Well, first you should load the 1.7.0.1 build versus a beta build. After that, then we can see if you still receive any type of exception.
By Govinda Berrio - 8/18/2009

Trent,



I installed the latest and greatest 1.7.0.1. Still getting the same error above. Any ideas?



Thank You
By Govinda Berrio - 8/19/2009

Hi,



any word on this error. Should I try some other testing?



Thank You
By Trent L. Taylor - 8/20/2009

Sorry, I have not been around lately. Actually I am not included to go straight to the SF update did this. I do not have a Telerik license, but the very first thing that I would do in testing this is see if the error persists using a DataGridView. This is generally out litmus test to see if something else could be in the mix. It appears that the TeleRik grid is trying to reset the Enumerator, which is not allowed, but there could be something else in the mix before we go straight to "it is the Telerik grid." I do recall a while back having to take something special into account for the Telerik grid, but I cannot recall exactly what it was.



Let me know if this test works. if so, then we need to isolate a sample with the Telerik grid that you can send me and then I will have to download a trial from Telerik to test it.
By Govinda Berrio - 8/21/2009

Hi,

just thought I would show this result after dragging a WBBS from the toolbar to the design surface. This is a brand new project I'm creating to test the WBBS with the GridView. It looks like the wrong assembly versions are being referenced... I'm not sure. This is probabaly unrelated, just thought I would mention it here.



[See screen shot attached]
By Edhy Rijo - 8/21/2009

Govinda Berrio (08/21/2009)
It looks like the wrong assembly versions are being referenced... I




Yeap, your project is referencing the old assemblies. Try deleting the references to the MicroFour assemblies and add them again. That should fix it, if not then try to locate all MicroFour assemblies and delete them, and re-install StrataFrame.
By Govinda Berrio - 8/21/2009

I think what's happening is that the project template is inserting references to 1.6 in the web.config file.
By Govinda Berrio - 8/21/2009

Trent,



I was able to run that test that you described. The binding to a plain GridView DID work with Strataframe. I also included a page with the RadGrid in the same situation and got the same error. So I guess this means it's Telerik's RadGrid that's doing something SF doesn't like. Is the Strataframe team inclined to fix things like this?



If you want to run the project, let me know if you need me to send the database and telerik dll.



Thank You,

Govinda
By Trent L. Taylor - 8/24/2009

You should not be the only person using a WBBS on a Telerik grid. So this is something that we will have to add to the "things to look at" list and download Telerik onto a Virtual Machine. So this may be a slightly longer turn-around, but I do want to take a look and see what is happening. Thanks.
By Govinda Berrio - 8/25/2009

Thanks Trent,



We would appreciate any help you could provide with this. It's really a problem for us.



Govinda
By Govinda Berrio - 9/1/2009

Hi Trent,



is there an update on this? Did you get a chance to setup that test machine with the Telerik trial?



Thanks,

Govinda
By Trent L. Taylor - 9/2/2009

Sorry, about the delayed response.



We have not been able to reproduce the error. Could you please post a sample as I may be doing something different than you. If you could use the StrataFrameSample database that would be good also. But any sample that is easy to load and reproduce the error would be helpful. Thanks.
By Govinda Berrio - 9/11/2009

Trent,



here is a project that reproduces the error I'm getting and uses the StrataFrameSample database. There are 2 pages, Default.aspx and WithRadGrid.aspx. Default uses the WBBS with a .net GridView and WithRadGrid uses WBBS with RadGrid. Click the "Fill Data" LinkButton to load the bound Businessobject with data from the dbo.Orders table.



Thanks in advance for your attention to this.



Govinda
By Govinda Berrio - 9/16/2009

Hi Trent,



Any status on this? Is the project that I uploaded usable? I'm pulling my hair trying to find workarounds for this.



Thanks,

Govinda
By Trent L. Taylor - 9/20/2009

Working on this morning and I will let you know what I find. We finally got a full license from Telerik which will make it easier to support you when these types of things come up. I just wanted to apologize for the delay on this post. You have been a saint waiting for an answer and I will get you one quickly. Thanks.
By Trent L. Taylor - 9/20/2009

Govinda,

One thing that I have learned over the years when dealing with web applications is that at times, the web.config is the root of many issues.  Combine that with weak typing and a typo here or there and it becomes hard to tell where the problem actually resides.

First, there was a configuration declaration causing an issue within the web.config file.  The declarations where actually correct in the sense that there were no typos.  However, certain AJAX components, such as the RadScriptManager, will update the config at times and through the use of some designer links (the little arrow at the top right when the control is selected).

At any rate, there were some version conflicts.  Note that I got the exact error that you were receiving right off of the bat, but I had to change the references as you are running an older version of Telerik AJAX than I am. 

Correcting the error:

  1. Open the web.config file.
  2. Comment out the <configSections>


  3. If you run now, you will receive a different error indicating that the field "id" doesn't belong to the data source.  This is due to a type somewhere.  I didn't go to the extent of determining the column where the typo existed.  I just cleared the data source and re-bound it to include all columns.
  4. After making this correction (the typo in the grid columns), if you run you will now see the data within the RadGrid as you have intended.

I have attached the corrected solution.  However, the references have been changed to 2009.2.826.20 to match my current version of Telerik.

So the good news is that there is no bug and your current version of SF will work just fine.  Hope this helps! Smile

By Govinda Berrio - 9/21/2009

Hi Trent,



Thanks for looking into this. I tried your recommendation and I'm still getting that error. I loaded the test project you sent; I changed the references to Telerik.Web.UI from 2009.2.826.20 to 2008.2.826.35 and the database connection string and ran it. Default.aspx ran fine but WithRadGrid.aspx gave the same error.



The last 2 digits of the version number represent the .net version it was compiled under (i believe). I'm wondering if you would get the same error if you tested with 2009.2.826.35? You should be able to find this assembly in the Bin35 directory under [C:\Program Files\Telerik\RadControls for ASPNET AJAX Q2 2008]. Can you please test this?



[InvalidOperationException: This is a single-use enumerator and cannot be reset.]

MicroFour.StrataFrame.Business.Enumerator.MoveNext() +130

MicroFour.StrataFrame.UI.Web.Enumerator.MoveNext() +95

Telerik.Web.UI.AdvancedEnumerator.MoveNext() +40

Telerik.Web.UI.GetEnumerator>d__0.MoveNext() +95

Telerik.Web.UI.GridDataTableFromEnumerable.FillDataTableFromEnumerable(IQueryable enumerable) +176

Telerik.Web.UI.GridDataTableFromEnumerable.FillData35() +3864

Telerik.Web.UI.GridDataTableFromEnumerable.FillData() +626

Telerik.Web.UI.GridResolveEnumerable.Initialize() +32

Telerik.Web.UI.GridResolveEnumerable.EnsureInitialized() +20

Telerik.Web.UI.GridEnumerableFromDataView..ctor(GridTableView owner, IEnumerable enumerable, Boolean CaseSensitive, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields) +151

Telerik.Web.UI.GridDataSourceHelper.CreateGridEnumerable(GridTableView owner, IEnumerable enumerable, Boolean caseSensitive, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields) +129

Telerik.Web.UI.GridDataSourceHelper.GetResolvedDataSource(GridTableView owner, Object dataSource, String dataMember, Boolean caseSensitive, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields) +383

Telerik.Web.UI.GridTableView.get_ResolvedDataSource() +141





Thank You,

Govinda
By Govinda Berrio - 9/24/2009

Hi,



just following up on my last post. Does it make sense for you to do that test?



Thanks,

Govinda
By Trent L. Taylor - 9/25/2009

I have not been able to reproduce the error since I have modified your project. Is it possible for you to download the most recent Telerik build and test the project and then work backwards from there?
By Govinda Berrio - 9/30/2009

Trent,

I downloaded and installed the latest version of Telerik.



Using the 2009.2.826.20 version works fine and that's what I'll do going forward. But the 2009.2.826.35 version doesn't seem to be working for me.



Govinda