Here are some things to contemplate:
private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e)
{
dataGridView1->Columns->Add("asdf", "myASDF");
// set the column width
dataGridView1->Columns[0]->Width = 444;
// Add some rows
for (int i = 0; i < 3; i++)
{
dataGridView1->Rows->Add();
dataGridView1->Rows[i]->Cells[0]->Value = "adsf " + i.ToString();
}
// Change the header text color
dataGridView1->Columns[0]->HeaderCell->Style->ForeColor = Color::Green;
// Change a cell's text color
dataGridView1->Rows[1]->Cells[0]->Style->ForeColor = Color::Red;
}
thines01
Postaholic
2,424 posts since Oct 2009
Reputation Points: 445
Solved Threads: 402