This is a migrated thread and some comments may be shown as answers.

treeview loading non-selfreference data

1 Answer 82 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
tim
Top achievements
Rank 1
tim asked on 01 Apr 2011, 09:18 AM
Dear telerik team,

I'm just new at silverlight and programming c#, i've seen many examples how to load data into a treeview but i'm not that good at programming it hence the reason why i ask  this question.How can i fix next problem?

i want to create a 2 layerd treeview which the childnodes are linked to a radgridview

these are my tables http://img340.imageshack.us/i/tablesv.jpg/

now i want industrie and hoofdgroepindustrie to be in the treeview , and i want to show the subgroepindustrie's data when people click on the hoofdgroepindustrie in the tree.
so far i only managed to get the industrie in my tree , could anyone explain me step by step what to do

thank you for reading.
namespace ILA.Web.Services
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Data.Objects.DataClasses;
    using System.Linq;
    using System.ServiceModel.DomainServices.Hosting;
    using System.ServiceModel.DomainServices.Server;
 
 
    // The MetadataTypeAttribute identifies GebruikerMetadata as the class
    // that carries additional metadata for the Gebruiker class.
    [MetadataTypeAttribute(typeof(Gebruiker.GebruikerMetadata))]
    public partial class Gebruiker
    {
 
        // This class allows you to attach custom attributes to properties
        // of the Gebruiker class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class GebruikerMetadata
        {
 
            // Metadata classes are not meant to be instantiated.
            private GebruikerMetadata()
            {
            }
 
            public int GebruikerID { get; set; }
 
            public int Lezen { get; set; }
 
            public string Naam { get; set; }
 
            public Recht Recht { get; set; }
 
            public int RechtID { get; set; }
 
            public int Toevoegen { get; set; }
 
            public int Verwijderen { get; set; }
 
            public string Wachtwoord { get; set; }
 
            public int Wijzigen { get; set; }
        }
    }
 
    // The MetadataTypeAttribute identifies HoofdgroepIndustrieMetadata as the class
    // that carries additional metadata for the HoofdgroepIndustrie class.
    [MetadataTypeAttribute(typeof(HoofdgroepIndustrie.HoofdgroepIndustrieMetadata))]
    public partial class HoofdgroepIndustrie
    {
 
        // This class allows you to attach custom attributes to properties
        // of the HoofdgroepIndustrie class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class HoofdgroepIndustrieMetadata
        {
 
            // Metadata classes are not meant to be instantiated.
            private HoofdgroepIndustrieMetadata()
            {
            }
            [Key]
            public int HoofdgroepIndustrieID { get; set; }
 
            public Industrie Industrie { get; set; }
 
            public int IndustrieID { get; set; }
 
            public string Naam { get; set; }
 
            public string Omschrijving { get; set; }
            [Include]
            [Association("SubgroepIndustries", "HoofdgroepIndustrieID", "HoofdgroepIndustrieID")]
            public EntityCollection<SubgroepIndustrie> SubgroepIndustries { get; set; }
        }
    }
 
    // The MetadataTypeAttribute identifies HoofdgroepProductMetadata as the class
    // that carries additional metadata for the HoofdgroepProduct class.
    [MetadataTypeAttribute(typeof(HoofdgroepProduct.HoofdgroepProductMetadata))]
    public partial class HoofdgroepProduct
    {
 
        // This class allows you to attach custom attributes to properties
        // of the HoofdgroepProduct class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class HoofdgroepProductMetadata
        {
 
            // Metadata classes are not meant to be instantiated.
            private HoofdgroepProductMetadata()
            {
            }
 
            public int HoofdgroepProductID { get; set; }
 
            public EntityCollection<Medium> Media { get; set; }
 
            public string Naam { get; set; }
 
            public string Omschrijving { get; set; }
 
            public EntityCollection<SubgroepProduct> SubgroepProducts { get; set; }
        }
    }
 
    // The MetadataTypeAttribute identifies IndustrieMetadata as the class
    // that carries additional metadata for the Industrie class.
    [MetadataTypeAttribute(typeof(Industrie.IndustrieMetadata))]
    public partial class Industrie
    {
 
        // This class allows you to attach custom attributes to properties
        // of the Industrie class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class IndustrieMetadata
        {
 
            // Metadata classes are not meant to be instantiated.
            private IndustrieMetadata()
            {
            }
            [Include]
            public EntityCollection<HoofdgroepIndustrie> HoofdgroepIndustries { get; set; }
            [Key]
            public int IndustrieID { get; set; }
 
            public EntityCollection<IndustrieInstallatie> IndustrieInstallaties { get; set; }
 
            public string Omschrijving { get; set; }
        }
    }
 
    // The MetadataTypeAttribute identifies IndustrieInstallatieMetadata as the class
    // that carries additional metadata for the IndustrieInstallatie class.
    [MetadataTypeAttribute(typeof(IndustrieInstallatie.IndustrieInstallatieMetadata))]
    public partial class IndustrieInstallatie
    {
 
        // This class allows you to attach custom attributes to properties
        // of the IndustrieInstallatie class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class IndustrieInstallatieMetadata
        {
 
            // Metadata classes are not meant to be instantiated.
            private IndustrieInstallatieMetadata()
            {
            }
 
            public Industrie Industrie { get; set; }
 
            public int IndustrieID { get; set; }
 
            public int IndustrieInstallatieID { get; set; }
 
            public Installatie Installatie { get; set; }
 
            public int InstallatieID { get; set; }
        }
    }
 
    // The MetadataTypeAttribute identifies InstallatieMetadata as the class
    // that carries additional metadata for the Installatie class.
    [MetadataTypeAttribute(typeof(Installatie.InstallatieMetadata))]
    public partial class Installatie
    {
 
        // This class allows you to attach custom attributes to properties
        // of the Installatie class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class InstallatieMetadata
        {
 
            // Metadata classes are not meant to be instantiated.
            private InstallatieMetadata()
            {
            }
 
            public string CRMID { get; set; }
 
            public DateTime Datum { get; set; }
 
            public EntityCollection<IndustrieInstallatie> IndustrieInstallaties { get; set; }
 
            public int InstallatieID { get; set; }
 
            public string JobID { get; set; }
 
            public Klant Klant { get; set; }
 
            public int KlantID { get; set; }
 
            public EntityCollection<MediaInstallatie> MediaInstallaties { get; set; }
 
            public int MinMediaScore { get; set; }
 
            public string Omschrijving { get; set; }
 
            public EntityCollection<ProductInstallatie> ProductInstallaties { get; set; }
 
            public EntityCollection<ToepassingInstallatie> ToepassingInstallaties { get; set; }
 
            public Verkoper Verkoper { get; set; }
 
            public int VerkoperID { get; set; }
        }
    }
 
    // The MetadataTypeAttribute identifies KlantMetadata as the class
    // that carries additional metadata for the Klant class.
    [MetadataTypeAttribute(typeof(Klant.KlantMetadata))]
    public partial class Klant
    {
 
        // This class allows you to attach custom attributes to properties
        // of the Klant class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class KlantMetadata
        {
 
            // Metadata classes are not meant to be instantiated.
            private KlantMetadata()
            {
            }
 
            public string ActiveKlantNr { get; set; }
 
            public EntityCollection<Installatie> Installaties { get; set; }
 
            public int KlantID { get; set; }
 
            public string Naam { get; set; }
 
            public string Tel { get; set; }
 
            public EntityCollection<Vestiging> Vestigings { get; set; }
        }
    }
 
    // The MetadataTypeAttribute identifies MediaInstallatieMetadata as the class
    // that carries additional metadata for the MediaInstallatie class.
    [MetadataTypeAttribute(typeof(MediaInstallatie.MediaInstallatieMetadata))]
    public partial class MediaInstallatie
    {
 
        // This class allows you to attach custom attributes to properties
        // of the MediaInstallatie class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class MediaInstallatieMetadata
        {
 
            // Metadata classes are not meant to be instantiated.
            private MediaInstallatieMetadata()
            {
            }
 
            public Installatie Installatie { get; set; }
 
            public int InstallatieID { get; set; }
 
            public int MediaID { get; set; }
 
            public int MediaInstallatieID { get; set; }
 
            public Medium Medium { get; set; }
        }
    }
 
    // The MetadataTypeAttribute identifies MediaStatuMetadata as the class
    // that carries additional metadata for the MediaStatu class.
    [MetadataTypeAttribute(typeof(MediaStatu.MediaStatuMetadata))]
    public partial class MediaStatu
    {
 
        // This class allows you to attach custom attributes to properties
        // of the MediaStatu class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class MediaStatuMetadata
        {
 
            // Metadata classes are not meant to be instantiated.
            private MediaStatuMetadata()
            {
            }
 
            public EntityCollection<Medium> Media { get; set; }
 
            public int MediaStatusID { get; set; }
 
            public string Omschrijving { get; set; }
 
            public int Score { get; set; }
        }
    }
 
    // The MetadataTypeAttribute identifies MediaTypeMetadata as the class
    // that carries additional metadata for the MediaType class.
    [MetadataTypeAttribute(typeof(MediaType.MediaTypeMetadata))]
    public partial class MediaType
    {
 
        // This class allows you to attach custom attributes to properties
        // of the MediaType class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class MediaTypeMetadata
        {
 
            // Metadata classes are not meant to be instantiated.
            private MediaTypeMetadata()
            {
            }
 
            public string Formaat { get; set; }
 
            public EntityCollection<Medium> Media { get; set; }
 
            public int MediaTypeID { get; set; }
 
            public string MIME { get; set; }
        }
    }
 
    // The MetadataTypeAttribute identifies MediumMetadata as the class
    // that carries additional metadata for the Medium class.
    [MetadataTypeAttribute(typeof(Medium.MediumMetadata))]
    public partial class Medium
    {
 
        // This class allows you to attach custom attributes to properties
        // of the Medium class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class MediumMetadata
        {
 
            // Metadata classes are not meant to be instantiated.
            private MediumMetadata()
            {
            }
 
            public string GUID { get; set; }
 
            public HoofdgroepProduct HoofdgroepProduct { get; set; }
 
            public Nullable<int> HoofdgroepProductID { get; set; }
 
            public string MediaFile { get; set; }
 
            public int MediaID { get; set; }
 
            public EntityCollection<MediaInstallatie> MediaInstallaties { get; set; }
 
            public string MediaNaam { get; set; }
 
            public MediaStatu MediaStatu { get; set; }
 
            public int MediaStatusID { get; set; }
 
            public byte[] MediaThumbnail { get; set; }
 
            public MediaType MediaType { get; set; }
 
            public int MediaTypeID { get; set; }
 
            public string Omschrijving { get; set; }
 
            public Product Product { get; set; }
 
            public Nullable<int> ProductID { get; set; }
 
            public SubgroepProduct SubgroepProduct { get; set; }
 
            public Nullable<int> SubgroepProductID { get; set; }
        }
    }
 
    // The MetadataTypeAttribute identifies ProductMetadata as the class
    // that carries additional metadata for the Product class.
    [MetadataTypeAttribute(typeof(Product.ProductMetadata))]
    public partial class Product
    {
 
        // This class allows you to attach custom attributes to properties
        // of the Product class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class ProductMetadata
        {
 
            // Metadata classes are not meant to be instantiated.
            private ProductMetadata()
            {
            }
 
            public EntityCollection<Medium> Media { get; set; }
 
            public string Naam { get; set; }
 
            public string Omschrijving { get; set; }
 
            public ProductFabrikant ProductFabrikant { get; set; }
 
            public int ProductFabrikantID { get; set; }
 
            public int ProductID { get; set; }
 
            public EntityCollection<ProductInstallatie> ProductInstallaties { get; set; }
 
            public ProductType ProductType { get; set; }
 
            public int ProductTypeID { get; set; }
 
            public SubgroepProduct SubgroepProduct { get; set; }
 
            public int SubgroepProductID { get; set; }
        }
    }
 
    // The MetadataTypeAttribute identifies ProductFabrikantMetadata as the class
    // that carries additional metadata for the ProductFabrikant class.
    [MetadataTypeAttribute(typeof(ProductFabrikant.ProductFabrikantMetadata))]
    public partial class ProductFabrikant
    {
 
        // This class allows you to attach custom attributes to properties
        // of the ProductFabrikant class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class ProductFabrikantMetadata
        {
 
            // Metadata classes are not meant to be instantiated.
            private ProductFabrikantMetadata()
            {
            }
 
            public string Naam { get; set; }
 
            public int ProductFabrikantID { get; set; }
 
            public EntityCollection<Product> Products { get; set; }
        }
    }
 
    // The MetadataTypeAttribute identifies ProductInstallatieMetadata as the class
    // that carries additional metadata for the ProductInstallatie class.
    [MetadataTypeAttribute(typeof(ProductInstallatie.ProductInstallatieMetadata))]
    public partial class ProductInstallatie
    {
 
        // This class allows you to attach custom attributes to properties
        // of the ProductInstallatie class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class ProductInstallatieMetadata
        {
 
            // Metadata classes are not meant to be instantiated.
            private ProductInstallatieMetadata()
            {
            }
 
            public Installatie Installatie { get; set; }
 
            public int InstallatieID { get; set; }
 
            public Product Product { get; set; }
 
            public int ProductID { get; set; }
 
            public int ProductInstallatieID { get; set; }
        }
    }
 
    // The MetadataTypeAttribute identifies ProductTypeMetadata as the class
    // that carries additional metadata for the ProductType class.
    [MetadataTypeAttribute(typeof(ProductType.ProductTypeMetadata))]
    public partial class ProductType
    {
 
        // This class allows you to attach custom attributes to properties
        // of the ProductType class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class ProductTypeMetadata
        {
 
            // Metadata classes are not meant to be instantiated.
            private ProductTypeMetadata()
            {
            }
 
            public string Omschrijving { get; set; }
 
            public EntityCollection<Product> Products { get; set; }
 
            public int ProductTypeID { get; set; }
        }
    }
 
    // The MetadataTypeAttribute identifies RechtMetadata as the class
    // that carries additional metadata for the Recht class.
    [MetadataTypeAttribute(typeof(Recht.RechtMetadata))]
    public partial class Recht
    {
 
        // This class allows you to attach custom attributes to properties
        // of the Recht class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class RechtMetadata
        {
 
            // Metadata classes are not meant to be instantiated.
            private RechtMetadata()
            {
            }
 
            public EntityCollection<Gebruiker> Gebruikers { get; set; }
 
            public string Recht1 { get; set; }
 
            public int RechtID { get; set; }
        }
    }
 
    // The MetadataTypeAttribute identifies SubgroepIndustrieMetadata as the class
    // that carries additional metadata for the SubgroepIndustrie class.
    [MetadataTypeAttribute(typeof(SubgroepIndustrie.SubgroepIndustrieMetadata))]
    public partial class SubgroepIndustrie
    {
 
        // This class allows you to attach custom attributes to properties
        // of the SubgroepIndustrie class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class SubgroepIndustrieMetadata
        {
 
            // Metadata classes are not meant to be instantiated.
            private SubgroepIndustrieMetadata()
            {
            }
             
            public HoofdgroepIndustrie HoofdgroepIndustrie { get; set; }
 
            public int HoofdgroepIndustrieID { get; set; }
 
            public string Naam { get; set; }
 
            public string Omschrijving { get; set; }
           
            [Key]
            public int SubgroepIndustrieID { get; set; }
        }
    }
 
    // The MetadataTypeAttribute identifies SubgroepProductMetadata as the class
    // that carries additional metadata for the SubgroepProduct class.
    [MetadataTypeAttribute(typeof(SubgroepProduct.SubgroepProductMetadata))]
    public partial class SubgroepProduct
    {
 
        // This class allows you to attach custom attributes to properties
        // of the SubgroepProduct class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class SubgroepProductMetadata
        {
 
            // Metadata classes are not meant to be instantiated.
            private SubgroepProductMetadata()
            {
            }
 
            public HoofdgroepProduct HoofdgroepProduct { get; set; }
 
            public int HoofdgroepProductID { get; set; }
 
            public EntityCollection<Medium> Media { get; set; }
 
            public string Naam { get; set; }
 
            public string Omschrijving { get; set; }
 
            public EntityCollection<Product> Products { get; set; }
 
            public int SubgroepProductID { get; set; }
        }
    }
 
    // The MetadataTypeAttribute identifies sysdiagramMetadata as the class
    // that carries additional metadata for the sysdiagram class.
    [MetadataTypeAttribute(typeof(sysdiagram.sysdiagramMetadata))]
    public partial class sysdiagram
    {
 
        // This class allows you to attach custom attributes to properties
        // of the sysdiagram class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class sysdiagramMetadata
        {
 
            // Metadata classes are not meant to be instantiated.
            private sysdiagramMetadata()
            {
            }
 
            public byte[] definition { get; set; }
 
            public int diagram_id { get; set; }
 
            public string name { get; set; }
 
            public int principal_id { get; set; }
 
            public Nullable<int> version { get; set; }
        }
    }
 
    // The MetadataTypeAttribute identifies ToepassingMetadata as the class
    // that carries additional metadata for the Toepassing class.
    [MetadataTypeAttribute(typeof(Toepassing.ToepassingMetadata))]
    public partial class Toepassing
    {
 
        // This class allows you to attach custom attributes to properties
        // of the Toepassing class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class ToepassingMetadata
        {
 
            // Metadata classes are not meant to be instantiated.
            private ToepassingMetadata()
            {
            }
 
            public string Detailomschrijving { get; set; }
 
            public string Hoofdomschrijving { get; set; }
 
            public int ToepassingID { get; set; }
 
            public EntityCollection<ToepassingInstallatie> ToepassingInstallaties { get; set; }
        }
    }
 
    // The MetadataTypeAttribute identifies ToepassingInstallatieMetadata as the class
    // that carries additional metadata for the ToepassingInstallatie class.
    [MetadataTypeAttribute(typeof(ToepassingInstallatie.ToepassingInstallatieMetadata))]
    public partial class ToepassingInstallatie
    {
 
        // This class allows you to attach custom attributes to properties
        // of the ToepassingInstallatie class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class ToepassingInstallatieMetadata
        {
 
            // Metadata classes are not meant to be instantiated.
            private ToepassingInstallatieMetadata()
            {
            }
 
            public Installatie Installatie { get; set; }
 
            public int InstallatieID { get; set; }
 
            public Toepassing Toepassing { get; set; }
 
            public int ToepassingID { get; set; }
 
            public int ToepassingInstallatieID { get; set; }
        }
    }
 
    // The MetadataTypeAttribute identifies VerkoperMetadata as the class
    // that carries additional metadata for the Verkoper class.
    [MetadataTypeAttribute(typeof(Verkoper.VerkoperMetadata))]
    public partial class Verkoper
    {
 
        // This class allows you to attach custom attributes to properties
        // of the Verkoper class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class VerkoperMetadata
        {
 
            // Metadata classes are not meant to be instantiated.
            private VerkoperMetadata()
            {
            }
 
            public string Adres { get; set; }
 
            public EntityCollection<Installatie> Installaties { get; set; }
 
            public string Land { get; set; }
 
            public string Naam { get; set; }
 
            public string Postcode { get; set; }
 
            public string Stad { get; set; }
 
            public int VerkoperID { get; set; }
 
            public string Voornaam { get; set; }
        }
    }
 
    // The MetadataTypeAttribute identifies VestigingMetadata as the class
    // that carries additional metadata for the Vestiging class.
    [MetadataTypeAttribute(typeof(Vestiging.VestigingMetadata))]
    public partial class Vestiging
    {
 
        // This class allows you to attach custom attributes to properties
        // of the Vestiging class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class VestigingMetadata
        {
 
            // Metadata classes are not meant to be instantiated.
            private VestigingMetadata()
            {
            }
 
            public string Adres { get; set; }
 
            public Klant Klant { get; set; }
 
            public int KlantID { get; set; }
 
            public string Land { get; set; }
 
            public string Postcode { get; set; }
 
            public string Stad { get; set; }
 
            public int VestigingID { get; set; }
        }
    }
}
namespace ILA.Web.Services
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Data;
    using System.Linq;
    using System.ServiceModel.DomainServices.EntityFramework;
    using System.ServiceModel.DomainServices.Hosting;
    using System.ServiceModel.DomainServices.Server;
 
 
    // Implements application logic using the ILA1Entities context.
    // TODO: Add your application logic to these methods or in additional methods.
    // TODO: Wire up authentication (Windows/ASP.NET Forms) and uncomment the following to disable anonymous access
    // Also consider adding roles to restrict access as appropriate.
    // [RequiresAuthentication]
    [EnableClientAccess()]
    public class IlaDSC : LinqToEntitiesDomainService<ILA1Entities>
    {
 
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Gebruikers' query.
        public IQueryable<Gebruiker> GetGebruikers()
        {
            return this.ObjectContext.Gebruikers;
        }
 
        public void InsertGebruiker(Gebruiker gebruiker)
        {
            if ((gebruiker.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(gebruiker, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Gebruikers.AddObject(gebruiker);
            }
        }
 
        public void UpdateGebruiker(Gebruiker currentGebruiker)
        {
            this.ObjectContext.Gebruikers.AttachAsModified(currentGebruiker, this.ChangeSet.GetOriginal(currentGebruiker));
        }
 
        public void DeleteGebruiker(Gebruiker gebruiker)
        {
            if ((gebruiker.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(gebruiker, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Gebruikers.Attach(gebruiker);
                this.ObjectContext.Gebruikers.DeleteObject(gebruiker);
            }
        }
 
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'HoofdgroepIndustries' query.
        public IQueryable<HoofdgroepIndustrie> GetHoofdgroepIndustries()
        {
            return this.ObjectContext.HoofdgroepIndustries.Include("SubGroepIndustries");
        }
 
        public void InsertHoofdgroepIndustrie(HoofdgroepIndustrie hoofdgroepIndustrie)
        {
            if ((hoofdgroepIndustrie.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(hoofdgroepIndustrie, EntityState.Added);
            }
            else
            {
                this.ObjectContext.HoofdgroepIndustries.AddObject(hoofdgroepIndustrie);
            }
        }
 
        public void UpdateHoofdgroepIndustrie(HoofdgroepIndustrie currentHoofdgroepIndustrie)
        {
            this.ObjectContext.HoofdgroepIndustries.AttachAsModified(currentHoofdgroepIndustrie, this.ChangeSet.GetOriginal(currentHoofdgroepIndustrie));
        }
 
        public void DeleteHoofdgroepIndustrie(HoofdgroepIndustrie hoofdgroepIndustrie)
        {
            if ((hoofdgroepIndustrie.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(hoofdgroepIndustrie, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.HoofdgroepIndustries.Attach(hoofdgroepIndustrie);
                this.ObjectContext.HoofdgroepIndustries.DeleteObject(hoofdgroepIndustrie);
            }
        }
 
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'HoofdgroepProducts' query.
        public IQueryable<HoofdgroepProduct> GetHoofdgroepProducts()
        {
            return this.ObjectContext.HoofdgroepProducts;
        }
 
        public void InsertHoofdgroepProduct(HoofdgroepProduct hoofdgroepProduct)
        {
            if ((hoofdgroepProduct.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(hoofdgroepProduct, EntityState.Added);
            }
            else
            {
                this.ObjectContext.HoofdgroepProducts.AddObject(hoofdgroepProduct);
            }
        }
 
        public void UpdateHoofdgroepProduct(HoofdgroepProduct currentHoofdgroepProduct)
        {
            this.ObjectContext.HoofdgroepProducts.AttachAsModified(currentHoofdgroepProduct, this.ChangeSet.GetOriginal(currentHoofdgroepProduct));
        }
 
        public void DeleteHoofdgroepProduct(HoofdgroepProduct hoofdgroepProduct)
        {
            if ((hoofdgroepProduct.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(hoofdgroepProduct, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.HoofdgroepProducts.Attach(hoofdgroepProduct);
                this.ObjectContext.HoofdgroepProducts.DeleteObject(hoofdgroepProduct);
            }
        }
 
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Industries' query.
        public IQueryable<Industrie> GetIndustries(bool loadproducts)
        {
            if (loadproducts)
            {
                return this.ObjectContext.Industries.Include("HoofdgroepIndustries").Include("HoofdgroepIndustries.SubgroepIndustries");
            }
            return this.ObjectContext.Industries;
            }
 
 
        public void InsertIndustrie(Industrie industrie)
        {
            if ((industrie.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(industrie, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Industries.AddObject(industrie);
            }
        }
 
        public void UpdateIndustrie(Industrie currentIndustrie)
        {
            this.ObjectContext.Industries.AttachAsModified(currentIndustrie, this.ChangeSet.GetOriginal(currentIndustrie));
        }
 
        public void DeleteIndustrie(Industrie industrie)
        {
            if ((industrie.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(industrie, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Industries.Attach(industrie);
                this.ObjectContext.Industries.DeleteObject(industrie);
            }
        }
 
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'IndustrieInstallaties' query.
        public IQueryable<IndustrieInstallatie> GetIndustrieInstallaties()
        {
            return this.ObjectContext.IndustrieInstallaties;
        }
 
        public void InsertIndustrieInstallatie(IndustrieInstallatie industrieInstallatie)
        {
            if ((industrieInstallatie.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(industrieInstallatie, EntityState.Added);
            }
            else
            {
                this.ObjectContext.IndustrieInstallaties.AddObject(industrieInstallatie);
            }
        }
 
        public void UpdateIndustrieInstallatie(IndustrieInstallatie currentIndustrieInstallatie)
        {
            this.ObjectContext.IndustrieInstallaties.AttachAsModified(currentIndustrieInstallatie, this.ChangeSet.GetOriginal(currentIndustrieInstallatie));
        }
 
        public void DeleteIndustrieInstallatie(IndustrieInstallatie industrieInstallatie)
        {
            if ((industrieInstallatie.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(industrieInstallatie, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.IndustrieInstallaties.Attach(industrieInstallatie);
                this.ObjectContext.IndustrieInstallaties.DeleteObject(industrieInstallatie);
            }
        }
 
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Installaties' query.
        public IQueryable<Installatie> GetInstallaties()
        {
            return this.ObjectContext.Installaties;
        }
 
        public void InsertInstallatie(Installatie installatie)
        {
            if ((installatie.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(installatie, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Installaties.AddObject(installatie);
            }
        }
 
        public void UpdateInstallatie(Installatie currentInstallatie)
        {
            this.ObjectContext.Installaties.AttachAsModified(currentInstallatie, this.ChangeSet.GetOriginal(currentInstallatie));
        }
 
        public void DeleteInstallatie(Installatie installatie)
        {
            if ((installatie.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(installatie, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Installaties.Attach(installatie);
                this.ObjectContext.Installaties.DeleteObject(installatie);
            }
        }
 
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Klants' query.
        public IQueryable<Klant> GetKlants()
        {
            return this.ObjectContext.Klants;
        }
 
        public void InsertKlant(Klant klant)
        {
            if ((klant.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(klant, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Klants.AddObject(klant);
            }
        }
 
        public void UpdateKlant(Klant currentKlant)
        {
            this.ObjectContext.Klants.AttachAsModified(currentKlant, this.ChangeSet.GetOriginal(currentKlant));
        }
 
        public void DeleteKlant(Klant klant)
        {
            if ((klant.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(klant, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Klants.Attach(klant);
                this.ObjectContext.Klants.DeleteObject(klant);
            }
        }
 
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'MediaInstallaties' query.
        public IQueryable<MediaInstallatie> GetMediaInstallaties()
        {
            return this.ObjectContext.MediaInstallaties;
        }
 
        public void InsertMediaInstallatie(MediaInstallatie mediaInstallatie)
        {
            if ((mediaInstallatie.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(mediaInstallatie, EntityState.Added);
            }
            else
            {
                this.ObjectContext.MediaInstallaties.AddObject(mediaInstallatie);
            }
        }
 
        public void UpdateMediaInstallatie(MediaInstallatie currentMediaInstallatie)
        {
            this.ObjectContext.MediaInstallaties.AttachAsModified(currentMediaInstallatie, this.ChangeSet.GetOriginal(currentMediaInstallatie));
        }
 
        public void DeleteMediaInstallatie(MediaInstallatie mediaInstallatie)
        {
            if ((mediaInstallatie.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(mediaInstallatie, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.MediaInstallaties.Attach(mediaInstallatie);
                this.ObjectContext.MediaInstallaties.DeleteObject(mediaInstallatie);
            }
        }
 
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'MediaStatus' query.
        public IQueryable<MediaStatu> GetMediaStatus()
        {
            return this.ObjectContext.MediaStatus;
        }
 
        public void InsertMediaStatu(MediaStatu mediaStatu)
        {
            if ((mediaStatu.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(mediaStatu, EntityState.Added);
            }
            else
            {
                this.ObjectContext.MediaStatus.AddObject(mediaStatu);
            }
        }
 
        public void UpdateMediaStatu(MediaStatu currentMediaStatu)
        {
            this.ObjectContext.MediaStatus.AttachAsModified(currentMediaStatu, this.ChangeSet.GetOriginal(currentMediaStatu));
        }
 
        public void DeleteMediaStatu(MediaStatu mediaStatu)
        {
            if ((mediaStatu.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(mediaStatu, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.MediaStatus.Attach(mediaStatu);
                this.ObjectContext.MediaStatus.DeleteObject(mediaStatu);
            }
        }
 
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'MediaTypes' query.
        public IQueryable<MediaType> GetMediaTypes()
        {
            return this.ObjectContext.MediaTypes;
        }
 
        public void InsertMediaType(MediaType mediaType)
        {
            if ((mediaType.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(mediaType, EntityState.Added);
            }
            else
            {
                this.ObjectContext.MediaTypes.AddObject(mediaType);
            }
        }
 
        public void UpdateMediaType(MediaType currentMediaType)
        {
            this.ObjectContext.MediaTypes.AttachAsModified(currentMediaType, this.ChangeSet.GetOriginal(currentMediaType));
        }
 
        public void DeleteMediaType(MediaType mediaType)
        {
            if ((mediaType.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(mediaType, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.MediaTypes.Attach(mediaType);
                this.ObjectContext.MediaTypes.DeleteObject(mediaType);
            }
        }
 
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Media' query.
        public IQueryable<Medium> GetMedia()
        {
            return this.ObjectContext.Media;
        }
 
        public void InsertMedium(Medium medium)
        {
            if ((medium.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(medium, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Media.AddObject(medium);
            }
        }
 
        public void UpdateMedium(Medium currentMedium)
        {
            this.ObjectContext.Media.AttachAsModified(currentMedium, this.ChangeSet.GetOriginal(currentMedium));
        }
 
        public void DeleteMedium(Medium medium)
        {
            if ((medium.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(medium, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Media.Attach(medium);
                this.ObjectContext.Media.DeleteObject(medium);
            }
        }
 
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Products' query.
        public IQueryable<Product> GetProducts()
        {
            return this.ObjectContext.Products;
        }
 
        public void InsertProduct(Product product)
        {
            if ((product.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(product, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Products.AddObject(product);
            }
        }
 
        public void UpdateProduct(Product currentProduct)
        {
            this.ObjectContext.Products.AttachAsModified(currentProduct, this.ChangeSet.GetOriginal(currentProduct));
        }
 
        public void DeleteProduct(Product product)
        {
            if ((product.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(product, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Products.Attach(product);
                this.ObjectContext.Products.DeleteObject(product);
            }
        }
 
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'ProductFabrikants' query.
        public IQueryable<ProductFabrikant> GetProductFabrikants()
        {
            return this.ObjectContext.ProductFabrikants;
        }
 
        public void InsertProductFabrikant(ProductFabrikant productFabrikant)
        {
            if ((productFabrikant.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(productFabrikant, EntityState.Added);
            }
            else
            {
                this.ObjectContext.ProductFabrikants.AddObject(productFabrikant);
            }
        }
 
        public void UpdateProductFabrikant(ProductFabrikant currentProductFabrikant)
        {
            this.ObjectContext.ProductFabrikants.AttachAsModified(currentProductFabrikant, this.ChangeSet.GetOriginal(currentProductFabrikant));
        }
 
        public void DeleteProductFabrikant(ProductFabrikant productFabrikant)
        {
            if ((productFabrikant.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(productFabrikant, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.ProductFabrikants.Attach(productFabrikant);
                this.ObjectContext.ProductFabrikants.DeleteObject(productFabrikant);
            }
        }
 
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'ProductInstallaties' query.
        public IQueryable<ProductInstallatie> GetProductInstallaties()
        {
            return this.ObjectContext.ProductInstallaties;
        }
 
        public void InsertProductInstallatie(ProductInstallatie productInstallatie)
        {
            if ((productInstallatie.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(productInstallatie, EntityState.Added);
            }
            else
            {
                this.ObjectContext.ProductInstallaties.AddObject(productInstallatie);
            }
        }
 
        public void UpdateProductInstallatie(ProductInstallatie currentProductInstallatie)
        {
            this.ObjectContext.ProductInstallaties.AttachAsModified(currentProductInstallatie, this.ChangeSet.GetOriginal(currentProductInstallatie));
        }
 
        public void DeleteProductInstallatie(ProductInstallatie productInstallatie)
        {
            if ((productInstallatie.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(productInstallatie, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.ProductInstallaties.Attach(productInstallatie);
                this.ObjectContext.ProductInstallaties.DeleteObject(productInstallatie);
            }
        }
 
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'ProductTypes' query.
        public IQueryable<ProductType> GetProductTypes()
        {
            return this.ObjectContext.ProductTypes;
        }
 
        public void InsertProductType(ProductType productType)
        {
            if ((productType.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(productType, EntityState.Added);
            }
            else
            {
                this.ObjectContext.ProductTypes.AddObject(productType);
            }
        }
 
        public void UpdateProductType(ProductType currentProductType)
        {
            this.ObjectContext.ProductTypes.AttachAsModified(currentProductType, this.ChangeSet.GetOriginal(currentProductType));
        }
 
        public void DeleteProductType(ProductType productType)
        {
            if ((productType.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(productType, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.ProductTypes.Attach(productType);
                this.ObjectContext.ProductTypes.DeleteObject(productType);
            }
        }
 
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Rechts' query.
        public IQueryable<Recht> GetRechts()
        {
            return this.ObjectContext.Rechts;
        }
 
        public void InsertRecht(Recht recht)
        {
            if ((recht.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(recht, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Rechts.AddObject(recht);
            }
        }
 
        public void UpdateRecht(Recht currentRecht)
        {
            this.ObjectContext.Rechts.AttachAsModified(currentRecht, this.ChangeSet.GetOriginal(currentRecht));
        }
 
        public void DeleteRecht(Recht recht)
        {
            if ((recht.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(recht, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Rechts.Attach(recht);
                this.ObjectContext.Rechts.DeleteObject(recht);
            }
        }
 
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'SubgroepIndustries' query.
        public IQueryable<SubgroepIndustrie> GetSubgroepIndustries()
        {
            return this.ObjectContext.SubgroepIndustries;
        }
 
        public void InsertSubgroepIndustrie(SubgroepIndustrie subgroepIndustrie)
        {
            if ((subgroepIndustrie.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(subgroepIndustrie, EntityState.Added);
            }
            else
            {
                this.ObjectContext.SubgroepIndustries.AddObject(subgroepIndustrie);
            }
        }
 
        public void UpdateSubgroepIndustrie(SubgroepIndustrie currentSubgroepIndustrie)
        {
            this.ObjectContext.SubgroepIndustries.AttachAsModified(currentSubgroepIndustrie, this.ChangeSet.GetOriginal(currentSubgroepIndustrie));
        }
 
        public void DeleteSubgroepIndustrie(SubgroepIndustrie subgroepIndustrie)
        {
            if ((subgroepIndustrie.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(subgroepIndustrie, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.SubgroepIndustries.Attach(subgroepIndustrie);
                this.ObjectContext.SubgroepIndustries.DeleteObject(subgroepIndustrie);
            }
        }
 
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'SubgroepProducts' query.
        public IQueryable<SubgroepProduct> GetSubgroepProducts()
        {
            return this.ObjectContext.SubgroepProducts;
        }
 
        public void InsertSubgroepProduct(SubgroepProduct subgroepProduct)
        {
            if ((subgroepProduct.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(subgroepProduct, EntityState.Added);
            }
            else
            {
                this.ObjectContext.SubgroepProducts.AddObject(subgroepProduct);
            }
        }
 
        public void UpdateSubgroepProduct(SubgroepProduct currentSubgroepProduct)
        {
            this.ObjectContext.SubgroepProducts.AttachAsModified(currentSubgroepProduct, this.ChangeSet.GetOriginal(currentSubgroepProduct));
        }
 
        public void DeleteSubgroepProduct(SubgroepProduct subgroepProduct)
        {
            if ((subgroepProduct.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(subgroepProduct, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.SubgroepProducts.Attach(subgroepProduct);
                this.ObjectContext.SubgroepProducts.DeleteObject(subgroepProduct);
            }
        }
 
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'sysdiagrams' query.
        public IQueryable<sysdiagram> GetSysdiagrams()
        {
            return this.ObjectContext.sysdiagrams;
        }
 
        public void InsertSysdiagram(sysdiagram sysdiagram)
        {
            if ((sysdiagram.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(sysdiagram, EntityState.Added);
            }
            else
            {
                this.ObjectContext.sysdiagrams.AddObject(sysdiagram);
            }
        }
 
        public void UpdateSysdiagram(sysdiagram currentsysdiagram)
        {
            this.ObjectContext.sysdiagrams.AttachAsModified(currentsysdiagram, this.ChangeSet.GetOriginal(currentsysdiagram));
        }
 
        public void DeleteSysdiagram(sysdiagram sysdiagram)
        {
            if ((sysdiagram.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(sysdiagram, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.sysdiagrams.Attach(sysdiagram);
                this.ObjectContext.sysdiagrams.DeleteObject(sysdiagram);
            }
        }
 
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Toepassings' query.
        public IQueryable<Toepassing> GetToepassings()
        {
            return this.ObjectContext.Toepassings;
        }
 
        public void InsertToepassing(Toepassing toepassing)
        {
            if ((toepassing.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(toepassing, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Toepassings.AddObject(toepassing);
            }
        }
 
        public void UpdateToepassing(Toepassing currentToepassing)
        {
            this.ObjectContext.Toepassings.AttachAsModified(currentToepassing, this.ChangeSet.GetOriginal(currentToepassing));
        }
 
        public void DeleteToepassing(Toepassing toepassing)
        {
            if ((toepassing.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(toepassing, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Toepassings.Attach(toepassing);
                this.ObjectContext.Toepassings.DeleteObject(toepassing);
            }
        }
 
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'ToepassingInstallaties' query.
        public IQueryable<ToepassingInstallatie> GetToepassingInstallaties()
        {
            return this.ObjectContext.ToepassingInstallaties;
        }
 
        public void InsertToepassingInstallatie(ToepassingInstallatie toepassingInstallatie)
        {
            if ((toepassingInstallatie.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(toepassingInstallatie, EntityState.Added);
            }
            else
            {
                this.ObjectContext.ToepassingInstallaties.AddObject(toepassingInstallatie);
            }
        }
 
        public void UpdateToepassingInstallatie(ToepassingInstallatie currentToepassingInstallatie)
        {
            this.ObjectContext.ToepassingInstallaties.AttachAsModified(currentToepassingInstallatie, this.ChangeSet.GetOriginal(currentToepassingInstallatie));
        }
 
        public void DeleteToepassingInstallatie(ToepassingInstallatie toepassingInstallatie)
        {
            if ((toepassingInstallatie.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(toepassingInstallatie, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.ToepassingInstallaties.Attach(toepassingInstallatie);
                this.ObjectContext.ToepassingInstallaties.DeleteObject(toepassingInstallatie);
            }
        }
 
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Verkopers' query.
        public IQueryable<Verkoper> GetVerkopers()
        {
            return this.ObjectContext.Verkopers;
        }
 
        public void InsertVerkoper(Verkoper verkoper)
        {
            if ((verkoper.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(verkoper, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Verkopers.AddObject(verkoper);
            }
        }
 
        public void UpdateVerkoper(Verkoper currentVerkoper)
        {
            this.ObjectContext.Verkopers.AttachAsModified(currentVerkoper, this.ChangeSet.GetOriginal(currentVerkoper));
        }
 
        public void DeleteVerkoper(Verkoper verkoper)
        {
            if ((verkoper.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(verkoper, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Verkopers.Attach(verkoper);
                this.ObjectContext.Verkopers.DeleteObject(verkoper);
            }
        }
 
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Vestigings' query.
        public IQueryable<Vestiging> GetVestigings()
        {
            return this.ObjectContext.Vestigings;
        }
 
        public void InsertVestiging(Vestiging vestiging)
        {
            if ((vestiging.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(vestiging, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Vestigings.AddObject(vestiging);
            }
        }
 
        public void UpdateVestiging(Vestiging currentVestiging)
        {
            this.ObjectContext.Vestigings.AttachAsModified(currentVestiging, this.ChangeSet.GetOriginal(currentVestiging));
        }
 
        public void DeleteVestiging(Vestiging vestiging)
        {
            if ((vestiging.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(vestiging, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Vestigings.Attach(vestiging);
                this.ObjectContext.Vestigings.DeleteObject(vestiging);
            }
        }
    }
}

xaml
<navigation:Page x:Class="ILA.Views.IndustrieBeheer"
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           d:DesignWidth="640" d:DesignHeight="480"
           Title="IndustrieBeheer Page" xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices" xmlns:my="clr-namespace:ILA.Web.Services" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" xmlns:my1="clr-namespace:ILA">
    <sdk:Page.Resources>
        <CollectionViewSource x:Key="industrieHoofdgroepIndustriesViewSource" Source="{Binding Path=Data.HoofdgroepIndustries, ElementName=industrieDomainDataSource}" />
        <CollectionViewSource x:Key="industrieHoofdgroepIndustriesSubgroepIndustriesViewSource" Source="{Binding Path=SubgroepIndustries, Source={StaticResource industrieHoofdgroepIndustriesViewSource}}" />
 
        <!--<telerik:DataTemplate x:Key="HoofdIndustrie">
            <TextBlock Text="{Binding Path=HoofdgroepIndustries.Naam}" ></TextBlock>
         
        </telerik:DataTemplate>-->
        <DataTemplate x:Key="Hoofdgroep" >
            <TextBlock Text="{Binding Omschrijving}" ></TextBlock>
        </DataTemplate>
         
        <telerik:HierarchicalDataTemplate x:Key="industrie">
            
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding Omschrijving}" Margin="5,0" />
                                <!--<TextBlock Text="{Binding Path=HoofdgroepIndustrie.omschrijving}"/>-->
            </StackPanel>
        </telerik:HierarchicalDataTemplate>
         
         
         
    </sdk:Page.Resources>
     
    <Grid x:Name="LayoutRoot">
         <riaControls:DomainDataSource AutoLoad="True" d:DesignData="{d:DesignInstance my:Industrie, CreateList=true}" Height="0" LoadedData="industrieDomainDataSource_LoadedData" Name="industrieDomainDataSource" QueryName="GetIndustriesQuery" Width="0">
            <riaControls:DomainDataSource.DomainContext>
                <my:IlaDSC />
            </riaControls:DomainDataSource.DomainContext>
        </riaControls:DomainDataSource>
         
         
        <StackPanel Margin="0,0,428,0">
            <telerik:RadTreeView Height="200" ItemsSource="{Binding ElementName=industrieDomainDataSource,Path=Data}" Name="treeview1" ItemTemplate="{StaticResource industrie}" Width="200"></telerik:RadTreeView>
            <!--<telerik:RadTreeView Height="200" ItemsSource="{Binding}" Name="treeview1" ItemTemplate="{StaticResource industrie}" Width="200"></telerik:RadTreeView>-->
        </StackPanel>
    </Grid>
</navigation:Page>

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 06 Apr 2011, 02:44 PM
Hello tim,

You can examine the attached project where a basic approach is realized. The RadtreeView is bound to DomainDataSourceCollection and when second level item is clicked additional info in shown in the GridView.

Greetings,
Petar Mladenov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
TreeView
Asked by
tim
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or