How can I setup custom column names for DataGridView with associated DataSource?
Here is some code:
class Key
{
public string Value { get; }
public DateTime ExpirationDate { get; }
}
List<Key> keys = new List<Key>();
...// fill keys collection
DataGridView dataGridView = createAndInitializeDataGridView();
dataGridView.DataSource = keys;
This gives me dataGridView with column names "Value" and "ExpirationDate". How should I proceed to change names to "Key" and "Expire" for example?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…