Master/Detail form

Jan 3, 2009 at 3:49 AM
How would I go about creating a master/detail form ?

Coordinator
Jan 6, 2009 at 11:10 AM
This version does not support any scenario for master details.
If you wish to see a specific scenario in the modeling tool and the generated code, please give us a suggestion on how we can model the master details and its properties.
Thanks Terry.
Negm

Mar 14, 2009 at 1:33 AM
Edited Mar 14, 2009 at 1:35 AM
The idea of Sculpture as I can understand it at the moment is that it is not giving your ready-to-use runtime application (the best example XAF by DevExpress). Instead it provides you with the source VS solution which you can modify any way you need.

So, for example to implement master-detail grids I created Linq+(Standard Library as a Service) + WinForms  Solution. Then I created two related (1-*) Entities in SculptureModel , processed generating and so got all the source files.
I pointed to Entity1List.cs designer file   (Entity1 is the parent entity). There in the form I inserted additional GridView named dgEntity2 under the  dgEntity1 (which was created by default).  Filled it with nesessary columns and then simply add code to code-behind file:

private

 

void dgEntity1_SelectionChanged(object sender, EventArgs e)
{

if (this.dgEntity1.SelectedRows.Count == 0) return;
_selectedEntity1 = dgEntity1.SelectedRows[0].DataBoundItem
as Entity1;

 

 

Entity2Reference.

Entity2ServiceClient ent2serviceclient = new Entity2Reference.Entity2ServiceClient();

 

 

List<Entity2> _entity2List = ent2serviceclient.GetByEntity1(_selectedEntity1.Id);
dgEntity2.AutoGenerateColumns =
false;
this.dgEntity2.DataSource = _entity2List;
}


The problems will occure when you need to regenerate model.
In fact we need:
1. to say Sculpture not to regenerate UI at all (not a good idea in case of adding many new entities into your model) 
2. or routinely copy customized forms and code files before regenerate model and then replacing them.

Both of variants seems to be inconveniant so it is matter of fact that 'partial' regenerating in Sculpture  would be very appreciated :)  Hope we'll see it in the next release.

 

 

 

 

Coordinator
Mar 15, 2009 at 11:50 AM
Hi dakmitos

"The idea of Sculpture as I can understand it at the moment is that it is not giving your ready-to-use runtime application"

Till now i can agree with you, But the main target of Sculpture is to generate code that can be regenerated in any phase of the software life cycle not just as a starter kit, yes it will not be ready for use (some custom code will be needed).
So we work hardly in Sculpture 2 to achieve this target.


"1. to say Sculpture not to regenerate UI at all (not a good idea in case of adding many new entities into your model) "

Currently we support this feature by the property "Generate UI Forms" of the Sculpture Model.
But we will currently develop more and more options about the generation process.

Thank you.
Negm.