New Posts New Posts RSS Feed: [Resolved]Accessing current DetailGrid object???????
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

[Resolved]Accessing current DetailGrid object???????

 Post Reply Post Reply Page  <1 234
Author
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 Topic: [Resolved]Accessing current DetailGrid object???????
    Posted: 02-Jan-2008 at 9:28am
When I do that I get the following error. And I can't track where it is being thrown from.
 
 
"Could not find an appropriately matching constructor."
 
All i have done so far is Inherit from the DevExBasicGridView and add Register it.


Edited by orcities - 02-Jan-2008 at 1:13pm
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: 02-Jan-2008 at 7:19am
So I also need to create my own presenter? And My own SetDetailGridViewBuilder method?
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: 28-Dec-2007 at 5:06pm
Look at DevExBasicGridView (in IdeaBlade.Cab.DevEx).
 
You'll need to create your own MYDevExBasicGridView inheriting from DevExBasicGridView, define a public InjectPresenter() method [with the "new" modifier], and register it with the ViewFactoryService in place of the standard DevExBasicGridView.
 
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: 28-Dec-2007 at 10:09am
DataGridView does not implement InjectPresenter and the Presenter does not have the SetDetailGridViewBuilder Class
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: 21-Dec-2007 at 2:26pm
Two questions in this thread.
 
Regarding the first:
 
As you can see in GridViewPresenter.cs (in IdeaBlade.Cab.UI), the detail grid(s) is (are) created by invoking the DevExDetailGridViewBuilder (set by the view at presenter injection time because it's dependent on the particular view technology--DevEx in this case).
 
The DevExDetailGridViewBuilder (in IdeaBlade.Cab.DevEx) actually creates the grid, creating a detail grid binding manager and binding it to a Relation property of the master object.
 
Unfortunately, getting at the detail grid binding manager and its data source is tough since they are not exposed to the presenter.  You can inherit from DevExDetailGridViewBuilder and override CreateDetailGrid().  Call the base method, then, before returning, set the detail binding manager into the DetailGridViewContext (you'll need your own derived detail context class to have a place to put it).
 
The next problem is that the type of the detail grid builder is hard-coded into the DevExGridView rather than being taken from the GridBuilderService.
 
You might be able to inherit from DevExBasicGridView and override the InjectPresenter() method.  Call SetPresenter(), then call
 
pPresenter.SetDetailGridViewBuilder(new MYDetailGridViewBuilder(GridBindingManager));
 
to substitute your detail grid view builder for the standard one.
 
I haven't tried this, so there might be some gotchas I've missed.  You'll have to make the call as to whether its worth it.
 
Regarding, the second question, yes you're on the right track.  By overriding DevExBasicGridView you can inject your custom presenter type.
 
The master grid is created by GridViewPresenter when the ViewContext has been set.
 
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: 19-Dec-2007 at 3:19pm
Bill please confirm something for me.
 
If I want to add drag and drop or any other functionality to the DataGridView I will need to do the following:
 
Create:
 I[x]GridViewPresenter
 [x]GridViewPresenter : I[x]GridViewPresenter
        in the AddDetailGrid callthe appropriate GridViewBuilder that implements my events
 [x]GridViewAdapter that calls the approprate [x]GridViewContextBase that sets the event handler
 
Then in the View call the appropriate [x]GridViewPresenter class.
 
I haven't been able to find where it builds the root Grid.
 
Is this close to correct.
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: 19-Dec-2007 at 9:13am
What I have found is that if I try and use the detailViewContext.BindingSource it reverts to the BindingSource of the Root grid.
 
Any help would be great.
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: 14-Dec-2007 at 9:58am
If you have a grid and you want to add a nested grid in it (DetailGrid) you add the DetailGridViewContext to the current GridViewContext.
 
I am trying to figure out how to get the currently selected item from that DetailGrid. I can get the current parent Item using the BindingSource.Current. But I have been unsuccessful in getting the Child items current.
 
Anyone have a clue.
 
Bill????


Edited by orcities - 11-Feb-2008 at 1:09pm
Back to Top
 Post Reply Post Reply Page  <1 234

Forum Jump Forum Permissions View Drop Down