Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
830
Child Bands Using Custom Classes
posted

Hi,

I have 2 Custom c# Classes called BLPerson and BLProjectAccess. BLPerson contains many properties including  int PersonId which uniquely identifies a BLPerson object and also a property called ProjectAccesss which returns a Collection<BLProjectAccess>

BLProjectAccess contains many properties also including int PersonId (the link between BLPerson and BLProjectAccess) . Importantly BLPerson.PersonId is a public property BLProjectAccess.PersonId is an internal property.

 I want to set up a WebHierarchicalDataGrid with parent of BLPerson and child of BLProjectAccess, the idea being that the User can “open up” a person and see the project accesses he/she has. From watching the videos it appears that I need to set up 2 ObjectDataSources for the 2 classes and also a WebHierarchicalDataSource and then configure the WebHierarchicalDataSource so that the parent points to the BLPerson ObjectDataSource and the Child to the BLProjectAccess ObjectDataSource and then add a WebHierarchicalDataGrid and set its Datasource to the WebHierarchicalDataSource.

 The problem I have is when I try to set up the child I need to provide “Joining” fields between the 2 classes which is PersonId, I can select this for the parent but not the child because it does not display in the drop down list as it is not a public property.  Is there a way to get round this without changing the BLProjectAccess.PersonId property to public as I would prefer calling classes not to be able to access this directly.

 Thanks John

  • 29417
    Offline posted

    Hello jvinnell ,

     

    I’m just following up to see if you’ve been able to resolve your issue. If you have any questions or concerns or if you need further assistance please let me know.

     

    Best Regards,

    Maya Kirova

    Developer Support Engineer

    Infragistics, Inc.

    http://ko.infragistics.com/support

     

  • 29417
    Offline posted

    Hello John, 

    Thank you for posting in our forum.

    The class will have to have public properties  in order for the WebHierarchicalDataSource to have access to them. If you want you could make the setters private so that the values can’t be changed directly.  For example:

    public int PersonID { get; private set; } 

    Let me know if you have any questions or concerns.

     

    Best Regards,

    Maya Kirova

    Developer Support Engineer II

    Infragistics, Inc.

    http://ko.infragistics.com/support