Print Page | Close Window

CABANA with EF

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=810
Printed Date: 25-Apr-2024 at 8:03am


Topic: CABANA with EF
Posted By: -ZI-
Subject: CABANA with EF
Date Posted: 19-May-2008 at 1:56pm
I am in process of porting CABANA to work with DevForce EF. I am running into some issues and looking for some help. In my example code, I am using a SearchSummaryDetail page. All the three views (Search, Summary, and Detail with tabs) seem to work fine if only one of these views are loaded by controller. But as soon as I add more than one views (any combination), I get an exception "Datasource or BoundType must be set before adding bindings with this signature."
 
So for example, if I display just the search and gridview section, it works fine. When I add Summary View, it starts breaking. If I keep the summary view and comment out the gridbuilder code where it adds columns, it still works fine. Search still pulls results (with an empty grid of course) but I can navigate through the result set and see the records changing in summary view. Similarly if keep the summary view and add a detail view (while keeping the gridbuilder add columns section commented), it again starts breaking with same error message. Debugging and stepping through the code, it appears that whichever view gets first turn succeeds adding itself but subsequent views throw exceptions of datasource not being there.
 
I have a similar prototype working with cabana and IdeaBlade's classic persistence. The page controller code/logic and overrides etc are  pretty much same in both prototypes. Any ideas what could be wrong. Is it the new EntityManager that manages thing differently than the classic one. Any tips that can help. 



Replies:
Posted By: -ZI-
Date Posted: 20-May-2008 at 12:23pm
I have done some more debugging and found out the exact line of code where it breaks (bold red line below). This code snippet is from ControlViewPresenter.cs. I can not step in more than this since mBindingManager is of type IdeaBlase.UI.WinForms.ControlBindingManager. source is not null in this case.

private void SetBindingManagerBindingSource() {

BindingSource source = ViewContext.BindingSource;

Guard.ArgumentNotNull(source, "ViewContext.BindingSource");

mBindingManager.BindingSource = source;

IsBindingSourceReady = true; // presumptively so if set.

PlayDelayedCommandsQueue(); }

 
The exception I get is

"Object reference not set to an instance of an object."

I have done debugging with various combinations of views and got similar results.



Print Page | Close Window