Monday, September 06, 2010
Support » Support Forum
Register Login
HomeWhat is NDO?- Executive Overview- NDO for DevelopersHow NDO Works- Persistent Classes- Mapping- Queries- Reverse Engineering- Inheritance, Polymorphism- Distributed ApplicationsLicensingSupport- Support Forum- FAQ- Solutions- Downloads- E-Mail Support- Tutorial VideosOnline ShopContact
Welcome to the NDO support forum!
Please register/login at the site if you want to post a thread. We sometimes copy support mails of common interest to the forum. They appear with anonymous sender. Please post your messages in English language if possible. You can do your posts also in German, we will translate your post and our answer so that all users of the forum can read your posts. The forum software requires that javascript is enabled. Please do not insert licence information or licence keys in forum posts. If you know a good answer to a post of another user, feel free to reply! The forum is monitored. We reserve the right to remove posts we consider not to be useful for other forum users.
Hi,
I'm a newbi an ndo. I want to bind a ilist on a Janus Grid. i create a Ilist like
Dim query1 As Query = pm.NewQuery(GetType(kunden))
li = query1.Execute
The problem is now that ndo creates only a "read only list" for the child-objects. If it possible to create a a read-write Ilist to connect the grid on the list ?
Thanks Igor
Hi Igor,
thanks for your interest in NDO. NDO can use any IList or IList<T> implementation for relations. So if the NDOReadOnlyGenericList doesn't fit your needs, just use a List<T>:
[NDOPersistent]public class MyPersistentClass{ List<anotherPersistentClass> myRelation = new List<anotherPersistentClass>(); List<anotherPersistentClass> MyRelation { get { return myRelation; } set { myRelation = value; } } ...}
To propagate Add and Delete operations between the grid and the list, use the NDOBindingSource component instead of the BindingSource component of the .NET framework. You can install the NDO.Databinding.dll in the VS 2005 toolbox (right click into the toolbox and choose "Choose items..."). After that the component can be drawn from the toolbox into the designer window as usual. Or you edit the binding properties of your grid control in the normal way you did it before and rename the type of the BindingSource in the xxx.designer.cs file.
See also this sample.
If you have further questions, I'm glad to answer it.
Best RegardsMirko
Thanks Mirko..
my problem is to fill this a list with the chield objects if i use a other list and not the NDOReadOnlyGenericList.
Whaths the matter ?
Public Property Pkontakte() As IList(Of kontakte)
Get
Return New NDOReadOnlyGenericList(Of kontakte)(p_kontakte)
End Get
Set(ByVal Value As IList(Of kontakte))
p_kontakte = CType(Value, List(Of kontakte))
End Set
End Property
NDO fills the list automatically as soon as it is touched. In your example it happens in the moment the variable p_kontakte in the accessor property is touched:
Public Property Pkontakte() As List(Of kontakte)
Get Return p_kontakte // loads the child objectsEnd Get
Set(ByVal Value As IList(Of kontakte)) p_kontakte = valueEnd Set
End PropertyNote: If you use DataBinding, there is no value in using the IList(of....) type instead of List(of....) .