Search   

Monday, September 06, 2010

Support » Support Forum

Register  Login

 Menu  
 
    

 Welcome!  
 


Welcome to the NDO support forum!

kreis.gif 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.
kreis.gif 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.
kreis.gif The forum software requires that javascript is enabled.
kreis.gif Please do not insert licence information or licence keys in forum posts.
kreis.gif If you know a good answer to a post of another user, feel free to reply!
kreis.gif The forum is monitored. We reserve the right to remove posts we consider not to be useful for other forum users.

   Print   

      
 NDO Support Forum  
 
SearchForum Home
  NDO-Forum postings in english please, if possible.  Developing with NDO  Binding al ilis...
 Binding al ilist on a grid
 
 11/19/2007 7:55:41 PM
iwerner
6 posts


Binding al ilist on a grid

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

 

 

 11/20/2007 8:39:14 AM
Mirko
109 posts
5th


Re: Binding al ilist on a grid

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 Regards
Mirko

 11/20/2007 1:25:28 PM
iwerner
6 posts


Re: Binding al ilist on a grid

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 ?

<NDORelation(RelationInfo.Composite, "rolename")> Dim p_kontakte As List(Of kontakte) = New List(Of kontakte)()

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

 

 11/20/2007 1:38:18 PM
Mirko
109 posts
5th


Re: Binding al ilist on a grid

Hi Igor,

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 objects
End Get

Set(ByVal Value As IList(Of kontakte))
  p_kontakte = value
End Set

End Property

Note: If you use DataBinding, there is no value in using the IList(of....) type instead of List(of....) .

Best Regards
Mirko

 11/22/2007 9:15:23 AM
iwerner
6 posts


Re: Binding al ilist on a grid
Thanks it works :)
  NDO-Forum postings in english please, if possible.  Developing with NDO  Binding al ilis...
  SearchSearch  Forum HomeForum Home