New Posts New Posts RSS Feed: DetailGridViewContext
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

DetailGridViewContext

 Post Reply Post Reply
Author
Bill Jensen View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 31-Jul-2007
Location: United States
Posts: 229
Post Options Post Options   Quote Bill Jensen Quote  Post ReplyReply Direct Link To This Post Topic: DetailGridViewContext
    Posted: 12-Feb-2008 at 3:13pm
Things have been moved around some in my version, but TabViewController (and that code) is still in IdeaBlade.Cab.UI, not in your application.  Find the specific tab view controller for your Business GridView.
Back to Top
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Posted: 12-Feb-2008 at 2:47pm
TabViewController: 246 is where I copied the code from.
Back to Top
Bill Jensen View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 31-Jul-2007
Location: United States
Posts: 229
Post Options Post Options   Quote Bill Jensen Quote  Post ReplyReply Direct Link To This Post Posted: 12-Feb-2008 at 2:44pm

Location, Blah, Person, Business all point to Group. 1 entry in group consists of a reference from each table. Each person can have multip locations in a business as well as a specific blah.

OK.  You can still only bind the detail grid to one entity.  I still think the easiest way is to add properties to Location to access the (single) Blah and expose its property values.
 
The tab does call RefreshEntities as stated but according to the Lib does not call GetBindingData():
 
The code you quote is from DetailViewController in IdeaBlade.Cab.UI. 
 
I'm talking about the ...TabViewController in your application that displays the main grid view (bound to Business). 
 
B
Back to Top
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Posted: 12-Feb-2008 at 2:17pm
Location, Blah, Person, Business all point to Group. 1 entry in group consists of a reference from each table. Each person can have multip locations in a business as well as a specific blah.
 
The tab does call RefreshEntities as stated but according to the Lib does not call GetBindingData():
 

protected IList RefreshEntities(IAppView pActiveTabView, Entity pParentEntity,

      RefreshGetChildEntitiesMethod pGetMethod, IList pDefaultList)

{

 

      bool canRefresh = CanRefresh(pActiveTabView, pParentEntity);

 

      if ( canRefresh )

{

using ( new WaitCursor(GetWaitCursorContextControl(pActiveTabView)) )

{

                  return RefreshFromParent(pParentEntity, pGetMethod);

            }

      } else {

        return pDefaultList;

      }

}

Back to Top
Bill Jensen View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 31-Jul-2007
Location: United States
Posts: 229
Post Options Post Options   Quote Bill Jensen Quote  Post ReplyReply Direct Link To This Post Posted: 12-Feb-2008 at 2:07pm
GetBindingData() does not exist in TabViewController.
 
So where is the data for your main grid (the one bound to the Business entity) coming from?  Where are you creating the main GridView and its context?  If it's displayed on a detail tab of a Summary/Detail page, then it probably has a TabViewController (called "BusinessGridTabViewController" or something like that).  
 
The standard tab view controller generated by the DotNetGridView wizard (the only one in Cabana version 2.3.0.0) overrides Refresh() to call RefreshEntities(), passing a delegate to GetBindingData(). 
 
I want the Blah and Locations DetailGrid info in on grid not the 2 as shown.
 
This seems inconsistent with your schema.  Location and Blah are independent entities.   For a given Group, there could be different numbers of Locations and Blahs.  Even if there were the same number, how would the system know which Location goes with which Blah?
 
A grid can only be bound to one type.  You could bind the detail grid to Location, then add custom properties to the Location entity that navigate to the Blahs (by way of Group) and supply values derived from their property values.
 
Bill
Back to Top
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Posted: 12-Feb-2008 at 12:49pm
First of all thank you for the example.
Only 2 things.
 
1. GetBindingData() does not exist in TabViewController. This is a version difference once again. Where should I put it so that it is implemented appropriately.
 
2. I want the Blah and Locations DetailGrid info in on grid not the 2 as shown. The are associated to one instance of Group.
Back to Top
Bill Jensen View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 31-Jul-2007
Location: United States
Posts: 229
Post Options Post Options   Quote Bill Jensen Quote  Post ReplyReply Direct Link To This Post Posted: 12-Feb-2008 at 12:43pm
Hi Dan,
 
I built a small application as a demo.  I used a standard Summary-Detail page bound to Person.  I created a GridView bound to Business, with a TabViewController with Person as the parent entity.
 
GetBindingData() is a private static method in the wizard-generated BusinessGridViewTabViewController.  Mine looks like this:
 
// Implement this method to get or refresh bound data

private static IList GetBindingData(Entity pParentEntity, QueryStrategy pStrategy) {

IList bindingData = null;

Group group = ((Person)pParentEntity).Group;

bindingData = group.Businesses;

return bindingData;

}

In the CreateView() method of the same tab view controller, I created two Detail Contexts:

// Create the main grid view context

GridViewContext context = GridViewContext.AddNew(WorkItem, ViewId, mBindingSource);

// Add detail view contexts

DetailGridViewContext detailContext = new DetailGridViewContext(context, "Locations", typeof(Location), "Group.Locations");

context.DetailGridViewContexts.Add(detailContext);

detailContext = new DetailGridViewContext(context, "Blahs", typeof(Location), "Group.Blahs");

context.DetailGridViewContexts.Add(detailContext);

// Create the view

View = ViewFactory.AddNew(Constants.ViewNames.BasicGrid, WorkItem, ViewId, typeof(Business));

The result:
 
 
Is this what you want?
 
Bill J.
Back to Top
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Posted: 11-Feb-2008 at 11:55am
Bill,

Can't implement something that doesn't exist.  Can you tell me where I should put GetBindingData() so that it runs like the one you have mentioned.

Which reminds me when we a new release be ready for Cabana?

I am sorry my explanation doesn't make sense to you. I try to articulate the my examples but I always fall short. In my example Group holds references to multiple tables. I want to show the data from group but grouped by one of the other table values.

More clarification:
My current tab is showing Person "A". I would like the grid to show all information from Group for "A".  I want the Main grid to show only one instance of each business. And I want the detailgridContext to show all entries for Person "A" and the business object that it belongs to. 

Does that make better since or did I just muddy the water even more.

Example Data

Person: Bill
Business(2 Entries): IdeaBlade, DevForce
Location (2Entries): Emeryville, San Fransico
Blah: BlahBlah
Group (4 Entries):
Bill,IdeaBlade,Emeryville,Blah
Bill,IdeaBlade,San Fransico
Bill,DevForce, Emeryville, Blah
Bill,DevForce, San Fransico


Output for Bill:
-IdeaBlade
          Emeryville, Blah
          San Franciso
-DevForce
           Emeryville, Blah
           San Fransico





Edited by orcities - 11-Feb-2008 at 11:58am
Back to Top
Bill Jensen View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 31-Jul-2007
Location: United States
Posts: 229
Post Options Post Options   Quote Bill Jensen Quote  Post ReplyReply Direct Link To This Post Posted: 08-Feb-2008 at 11:20am
Dan,
 
Bind your grid view to Business.  In the TabViewController for your GridView, implement GetBindingData() to query only the Businesses associated (via Group) with the current active Person (parent Entity).
 
I'm not sure what "I want...the DetailGridViewContext to display the Group information" means, but there is an overload of the DetailViewContext constructor that accepts a property path.  You could use that to display all Locations associated with the Business selected in the master view.  You could add a second DetailViewContext to display all Blahs associated with the currently selected Business.
 
Bill J.
Back to Top
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Posted: 07-Feb-2008 at 10:25am

I have a table that is the intermidiary table between many different tables. If I want the GridViewContext to be of one of those types and point back to the intermidiary table but only show the records associated to on specific type.

Example:
Person (PersonId)
Business (BusinessId)
Location(LocationId)
Blah(BlahBlahId)
Group (PersonId, BusinessId, LocationId, BlahBlahId)
 
Person ->Group<- Business
                ^  ^
Location _|    |_ Blah
 
Person can have multiple locations
Person can have multiple blahs
Person can have multiple locations when associated to a business
Person can have multipe blahs when associated to a business
Group assications a person to multiple business and when assicated has specific location and blah.
 
The page is assication to a Person. I want the main GridViewContext to display the Business (basic grouping by business) that person is involved with and the DetailGridViewContext to display the Group information.
 
If I just did the Business as the GridViewContext it would show all of the entries that don't deal with a specific person.
 
How should I handle this?
 
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down