Mickeys
asked on
Add a new column to my GridView
How do I add an extra column to my gridview?
I have the code below.
This is what it looks like right now
Name Phone Adress
And I want to add one more column lilke this
Name Phone Adress E-mail
How?
I have the code below.
This is what it looks like right now
Name Phone Adress
And I want to add one more column lilke this
Name Phone Adress E-mail
How?
/// <summary>
/// Updater updates the gui
/// </summary>
private void Updater()
{
//Update the gridview
AnimalDataGridView.DataSource = null;
AnimalDataGridView.AutoGenerateColumns = true;
AnimalDataGridView.DataSource = animalManager.AnimalList;
nickNameTextBox.Text = "";
nrOfItems.Text = Convert.ToString(animalManager.Counter);
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Then you need to create a new property in class Contact called EmailAddress or your other columns.
Or
You need to mannually add columns in gridview of windows app and then bind to the specific property of the contact class.
Or
You need to mannually add columns in gridview of windows app and then bind to the specific property of the contact class.
ASKER
well I have managed to put it into the gridview manually but......how do I choose where it should be? Right now it is the first cell. I want it to be the last
ASKER
I am not using a sql data bas. My DataGridView is using a List<Contacts>