Im having a hardtime trying to get a datagridviewrow object from a instance of a dataset i have programmatically added. I have done it this way as to use the same methods as my other constructor which works from a selected row in the datagridview on the form.
My problem is that the datagridview.rows.count is always 0 . Reading the "ASME_AllowableStress.Rows.Count" i get the full table at 2600 rows. Im not sure what i am missing or declared wrong to not get the datagridview rows added. The columns appear to be added.
public Material(int mat_id)
{
this.ID = mat_id;
MaterialDataSet materialDataSet = new MaterialDataSet();
MaterialDataSetTableAdapters.ASME_2009_AllowableStressTableAdapter aSME_2009_AllowableStressTableAdapter = new MaterialDataSetTableAdapters.ASME_2009_AllowableStressTableAdapter();
MaterialDataSetTableAdapters.TableAdapterManager tableAdapterManager = new MaterialDataSetTableAdapters.TableAdapterManager();
aSME_2009_AllowableStressTableAdapter.Fill(materialDataSet.ASME_2009_AllowableStress);
DataGridView materialDataGridView = new DataGridView();
DataView myView = materialDataSet.Tables[0].DefaultView;
materialDataGridView.DataSource = myView;
MessageBox.Show(Convert.ToString(materialDataSet.ASME_2009_AllowableStress.Rows.Count));
MessageBox.Show(Convert.ToString(materialDataGridView.Rows.Count));
DataGridViewRow row = new DataGridViewRow();