Author |
Share Topic Topic Search Topic Options
|
orcities
Senior Member
Joined: 28-Aug-2007
Location: United States
Posts: 454
|
Post Options
Quote Reply
Topic: [Resolved]Tearing down MasterDetailTabController Posted: 08-Oct-2007 at 2:59pm |
I am trying to figure out how to do a few things. And to do so I needed to look at the MasterDetailTabViewController.
In looking at MDTC I have come up with a few questions. In which I will post seperatly in case one answer solves the next problem.
I have found the MDTC was very handy in creating my own contr. But I have had a few issues.
What I am doing instead of using the Editor feature, as the MDTC does to add, edit, or delete, is attempting to allow the user to edit the record on the same view. So in one section I have a grid and in the other the widget control with the textboxes and such for that item.
I have everything bound successfully but, my entity is always readonly. I have noticed that if an entity is readonly the controls are readonly, very handy. But I am not sure why it is readonly.
The binding source is an EntityBindingSource and has not explicitly been set to RO.
Edited by orcities - 10-Oct-2007 at 11:44am
|
|
orcities
Senior Member
Joined: 28-Aug-2007
Location: United States
Posts: 454
|
Post Options
Quote Reply
Posted: 08-Oct-2007 at 3:15pm |
I was able to do a really crappy work around. I am hoping to find a better solution. It seems that only my textboxes are going to readonly. I have verified that are enabled in the designer view. But they still come up reaonly on initial load of the project.
|
|
Linguinut
Senior Member
Joined: 14-Jun-2007
Location: United States
Posts: 394
|
Post Options
Quote Reply
Posted: 08-Oct-2007 at 4:45pm |
Originally posted by orcities
What I am doing . . . is attempting to allow the user to edit the record on the same view. |
I did this by creating a page (summary detail page is fine...you will not use the detail--key point). The summary view that is created via the wizard is where I put the controls that I use to edit a given entity (normal, so far). On that same view I added a grid (not quite normal). In the view's code I set the binding source of the new grid binding manager to the already existing control binding manager's. This works quite nicely. The navigator walks both the grid and controls at the same time. Anything edited in the controls shows up in the grid (and potentially, vice versa, though I did not try that). I may not really be understanding what you are trying to accomplish, but I hope this helps in some way.
|
|
orcities
Senior Member
Joined: 28-Aug-2007
Location: United States
Posts: 454
|
Post Options
Quote Reply
Posted: 09-Oct-2007 at 9:22am |
Mine needs to be in a tab control. I believe I have everything figured out I just have a few things to iron out. I have all things working fine now. Just gonna have to refactor it later.
|
|
Linguinut
Senior Member
Joined: 14-Jun-2007
Location: United States
Posts: 394
|
Post Options
Quote Reply
Posted: 09-Oct-2007 at 9:28am |
I guess tab controls are different. Sorry I couldn't help.
|
|
orcities
Senior Member
Joined: 28-Aug-2007
Location: United States
Posts: 454
|
Post Options
Quote Reply
Posted: 09-Oct-2007 at 9:33am |
not a problem
|
|
Bill Jensen
IdeaBlade
Joined: 31-Jul-2007
Location: United States
Posts: 229
|
Post Options
Quote Reply
Posted: 09-Oct-2007 at 10:52am |
Look at how your are supplying the DataSource to the BindingSource in your tab view controller. Are you using a query to get an entity list, or are you accessing a property of an entity that returns a simple array of entities?
Bill J.
|
|
orcities
Senior Member
Joined: 28-Aug-2007
Location: United States
Posts: 454
|
Post Options
Quote Reply
Posted: 09-Oct-2007 at 10:54am |
I am using an EntityQuery
|
|
Bill Jensen
IdeaBlade
Joined: 31-Jul-2007
Location: United States
Posts: 229
|
Post Options
Quote Reply
Posted: 10-Oct-2007 at 9:52am |
You may have already checked this, but MasterDetailTabViewController contains a protected virtual method:
ConfigureDetailGridViewContext()
The default in MDTC sets the ReadOnly flag.
Have you overridden this method in your TabViewController to NOT set the detail context to read only?
Bill J.
|
|
orcities
Senior Member
Joined: 28-Aug-2007
Location: United States
Posts: 454
|
Post Options
Quote Reply
Posted: 10-Oct-2007 at 9:54am |
From what I can tell that only tells it not to allow input into the cells. But I did try it.
|
|
orcities
Senior Member
Joined: 28-Aug-2007
Location: United States
Posts: 454
|
Post Options
Quote Reply
Posted: 10-Oct-2007 at 11:44am |
I think I figured out why they were readonly. I am not editing the current entity, because it is an association object, I am editing the a child to. So the child fields only are readonly. When I explicitly enable them they work fine.
|
|