DataGridView textBox = new DataGridView(); textBox.ColumnCount = 2; textBox.ColumnHeadersDefaultCellStyle.BackColor = Color.Navy; textBox.ColumnHeadersDefaultCellStyle.ForeColor = Color.White; textBox.ColumnHeadersDefaultCellStyle.Font = new Font(textBox.Font, FontStyle.Bold); textBox.Columns[0].Name = "ID"; textBox.Columns[1].Name = "Jméno"; string[] row0 = {listAnotaci[0].Key.ToString(),listAnotaci[0].Value};//It doesn't work like that, I just kind of imagined it without a cycle string[] row1 = { listAnotaci[1].Key.ToString(),listAnotaci[1].Value};//It doesn't work like that, I just kind of imagined it without a cycle textBox.Rows.Add(row0); textBox.Rows.Add(row1);
foreach (KeyValuePair<long, string> pair in listAnotaci) { textBox.Rows.Add(new[] { pair.Key.ToString(), pair.Value }); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)