Object graph databinding example needed

Object graph databinding example needed

Old forum URL: forums.lhotka.net/forums/t/11474.aspx


andrewrajcoomar posted on Saturday, July 14, 2012

Hi All,

Does anyone have or know of a good example you can share of two way data binding with an object graph. Let's say I have a root with a child and the child has a collection. I want to bind the root to a form view, the child to a detailsview and the grandchild to a gridview all at design time.

It is possible at all to have two way binding on nested objects done at design time?

Are there any CSLA books with such an example? I have BO 2005 and 2008 and 2.1 handbook and have looked at the PT sample, but seem to be missing any examples if they are in there.

Thanks for your help.

Andrew

 

skagen00 replied on Saturday, July 14, 2012

It's not clear what UI technology you're talking about.

If you're talking MVVM with Silverlight/WPF...

If say you have one grid with an itemsource of the parent items, one can have a VM property bound to the selected item of that parent items grid.  The second grid (the children of the parents) can then be bound to that VM property "dot" the child collection property for its item source, and navigating through the parent items will cause the second grid (the details of the parent) to refresh.  (You need to make sure your VM property for selected item is a dependency property or raises OnPropertyChanged to deal with the databinding notification).

 

andrewrajcoomar replied on Sunday, July 15, 2012

Thanks for your response.

I am using ASP.Net 3.5 framework, ASP.Net web application (UI) with AJAX, VS 2008 and CSLA 3.5. On the page I have a .net gridview control, detailsview and formview. I also have a CSLADatasource.

There's no Silverlight or any of the newer MS stuff like MVC or MVVM. I am using all data aware controls for the presentation and want to take advantage of two way binding at design time so that I do not have to get/set properties at run time.

I do have a fair idea of the implementation using the "dot" referencing and have been able to get a part of it to work. I am hoping to see a more concrete example of an implementation, if possible.

Thanks.

Copyright (c) Marimer LLC