Now that I've finished my exam yesterday I am ready to get back into this with a fresh mind. So I was able to find a tutorial that showed me how to do it. There are no data bindings involved, or anything remotely complicated about it.
In fact its kind of embarrassing that it is so simple. Instead of creating a new class I moved the code into the Forms1.h file and added a load button with the following code.
Code:
private: System::Void loadTable_Click(System::Object * sender, System::EventArgs * e)
{
DataSet __gc *dsPersons = __gc new DataSet(S"Employees Records");
DataTable __gc *dtPersons = __gc new DataTable;
DataColumn __gc *dcCategory = __gc new DataColumn;
dcCategory->ColumnName = S"Name";
dcCategory->DataType = System::Type::GetType(S"System.String");
dtPersons->Columns->Add(dcCategory);
dcCategory = new DataColumn(S"Monday", System::Type::GetType(S"System.String"));
dtPersons->Columns->Add(dcCategory);
dcCategory = new DataColumn(S"Tuesday");
dcCategory->DataType = System::Type::GetType(S"System.String");
dtPersons->Columns->Add(dcCategory);
dcCategory = new DataColumn(S"Wednesday", System::Type::GetType(S"System.String"));
dtPersons->Columns->Add(dcCategory);
dcCategory = new DataColumn(S"Thursday", System::Type::GetType(S"System.String"));
dtPersons->Columns->Add(dcCategory);
dcCategory = new DataColumn(S"Friday", System::Type::GetType(S"System.String"));
dtPersons->Columns->Add(dcCategory);
dcCategory = new DataColumn(S"Saturday", System::Type::GetType(S"System.String"));
dtPersons->Columns->Add(dcCategory);
dsPersons->Tables->Add(dtPersons);
DataRow __gc *drPersons;
drPersons = dtPersons->NewRow();
drPersons->Item[S"Name"] = S"John Smith";
drPersons->Item[S"Monday"] = S"8:00 to 4:00";
drPersons->Item[S"Tuesday"] = S"OFF";
dtPersons->Rows->Add(drPersons);
drPersons = dtPersons->NewRow();
drPersons->Item[S"Name"] = S"Jill Smith";
drPersons->Item[S"Monday"] = S"9:00 to 5:00";
drPersons->Item[S"Tuesday"] = S"9:00 to 5:00";
dtPersons->Rows->Add(drPersons);
this->dataGrid1->DataSource = dsPersons;
this->dataGrid1->DataMember = S"Table1";
}
Now all I need to do is add the row information from my struct instead off hardcoding the values in.
For a full tutorial check out: http://www.functionx.com/vcnet/colle.../datatable.htm
These tutorials are very easy to understand for many other topics.
Have a good one all.