locked
DataGrid bindings to a list of complex dataTypes WPF(xaml) RRS feed

  • Question

  • Hello, 

    I have class contains List as Property that contains another class object as its property.

    Please find the class structure below which i have to bind to a datagrid/any control in wpf.

        public class EmployeeDetails
        {
            /// <summary>
            /// 
            /// </summary>
            public string EmpID { get; set; }

            /// <summary>
            /// 
            ///
            /// </summary>
            public List<Employee> Employee { get; set; }
        }
        public class Employee
        {
            /// <summary>
            /// 
            /// </summary>
            public string Id { get; set; }

            /// <summary>
            /// 
            /// </summary>
            public Department Department { get; set; }

            /// <summary>
            /// 
            /// </summary>
            public uint Priority { get; set; }
        }

        public class Department
        {
           

            /// <summary>
            /// 
            /// </summary>
            public uint ContactNo { get; set; }

            /// <summary>
            /// 
            /// </summary>
            public decimal Salary { get; set; }

            /// <summary>
            /// 
            /// </summary>
            public decimal Allowance { get; set; }

            /// <summary>
            /// 
            /// </summary>
            public JobType JobType { get; set; }

        }
        public enum JobType
        {
           Permanant,
            Temporary
        }

    Actually my model contains these much data.I have to bind these much information into a dataGrid using xaml binding attribute.

    Can anyone help me to solve this???


    Coding.....................................



    • Moved by CoolDadTx Friday, July 24, 2020 1:25 PM WPF related
    • Edited by La07K Friday, July 24, 2020 1:29 PM
    Friday, July 24, 2020 12:59 PM

All replies

  • This forum is for C#-specific questions only. Please post all questions related to using WPF/XAML controls in the WPF forums over on Microsoft Q&A.

    Michael Taylor http://www.michaeltaylorp3.net

    Friday, July 24, 2020 1:25 PM