PIbd-31_Danilov_V_V_COP-30/WinFormsTest/Form1.cs
2024-10-03 21:07:20 +04:00

47 lines
831 B
C#

using Components;
using Components.Object;
namespace WinFormsTest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
InitializeListBox();
InitializeDataGridView();
}
private void InitializeListBox()
{
customListBox.SetItems(new List<string>
{
"Hi 1",
"Hi 2",
"Hi 3",
"Hi 4",
"Hi 5",
});
}
private void InitializeDataGridView()
{
var columns = new List<(string HeaderText, string DataPropertyName, float FillWeight)>
{
("Èìÿ", "Name", 1),
("Âîçðàñò", "Age", 1),
("Email", "Email", 2)
};
customDataGridView1.ConfigureColumns(columns);
var data = new List<Person>
{
new Person ("Èâàí", 30, "ivan@gmail.com" ),
new Person ("Ìàðèÿ", 25, "maria@gmail.com")
};
customDataGridView1.FillData(data);
}
}
}