PIbd-31_Danilov_V_V_COP-30/WinFormsTest/Form1.cs

47 lines
831 B
C#
Raw Permalink Normal View History

2024-09-20 08:45:39 +04:00
using Components;
2024-10-03 21:07:20 +04:00
using Components.Object;
2024-09-20 08:45:39 +04:00
namespace WinFormsTest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
InitializeListBox();
2024-10-03 21:07:20 +04:00
InitializeDataGridView();
2024-09-20 08:45:39 +04:00
}
private void InitializeListBox()
{
customListBox.SetItems(new List<string>
{
"Hi 1",
"Hi 2",
"Hi 3",
"Hi 4",
"Hi 5",
});
}
2024-10-03 21:07:20 +04:00
private void InitializeDataGridView()
{
var columns = new List<(string HeaderText, string DataPropertyName, float FillWeight)>
{
("<22><><EFBFBD>", "Name", 1),
("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "Age", 1),
("Email", "Email", 2)
};
customDataGridView1.ConfigureColumns(columns);
var data = new List<Person>
{
new Person ("<22><><EFBFBD><EFBFBD>", 30, "ivan@gmail.com" ),
new Person ("<22><><EFBFBD><EFBFBD><EFBFBD>", 25, "maria@gmail.com")
};
customDataGridView1.FillData(data);
}
2024-09-20 08:45:39 +04:00
}
}