using CustomComponents.Classes; using System.Text; namespace TestForms { public partial class TestFrame : Form { public TestFrame() { InitializeComponent(); } private void clearButton_Click(object sender, EventArgs e) { listBox.Clear(); } private void fillButton_Click(object sender, EventArgs e) { listBox.PopulateList(new List { "SILENT", "RIZZ", "BLSSDY", "YUEEJKE" }); } private void buttonConfigureGridView_Click(object sender, EventArgs e) { frameCustomGridView1.ColumnConfiguration(5, new List() { "ID", "Login", "LoginTimes", "Town", "Creation" }, new List() { 50, 50, 50, 50, 50 }, new List { true, true, true, true, true }, new List { "ID", "Login", "LoginTimes", "Town", "Creation" }); buttonConfigureGridView.Visible = false; fillGridViewButton.Visible = true; getSelectedRowButton.Visible = true; } private void fillGridViewButton_Click(object sender, EventArgs e) { frameCustomGridView1.AddRows(new List() { new Account(1,"boba","idk"), new Account(2,"biba","idk"), new Account(3,"buba","idk") }); } private void getSelectedRowButton_Click(object sender, EventArgs e) { var obj = frameCustomGridView1.GetAccount(); var properties = obj.GetType().GetProperties(); StringBuilder sb = new StringBuilder(); foreach(var prop in properties) { sb.Append($"{prop.Name}: {prop.GetValue(obj)}\n"); } MessageBox.Show( sb.ToString() ); } } }