Ejemplo n.º 1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            dgvStudent.AutoGenerateColumns = false;

            var studentInfos = _service.GetStudentInfos();

            dgvStudent.DataSource = studentInfos;

            if (!studentInfos.Any())
            {
                return;
            }

            tlpStudent.SuspendLayout();

            var properties = _service.GetSortedStudentProperties(studentInfos.First());

            tlpStudent.Height = properties.Count * 31 + 25;
            properties.ForEach(g => tlpStudent.AddControl(g));

            tlpStudent.ResumeLayout();
        }