public void Form2_Load(object sender, EventArgs e) { dataGridView_Stitek.Rows.Clear(); DataTable dbtable = dt.getPracovniStitek(); int i = 0; foreach (DataRow dr in dbtable.Rows) { DataGridViewRow row = (DataGridViewRow)dataGridView_Stitek.Rows[i++].Clone(); row.Cells[0].Value = Convert.ToInt32(dr.ItemArray[0]); row.Cells[1].Value = dr.ItemArray[8]; row.Cells[3].Value = dt.getNazevTypStitek(Convert.ToInt32(dr.ItemArray[3])); row.Cells[4].Value = dt.getPredmet(Convert.ToInt32(dr.ItemArray[2])).Rows[0].ItemArray[1]; row.Cells[5].Value = dr.ItemArray[4]; row.Cells[6].Value = dr.ItemArray[5]; row.Cells[7].Value = dr.ItemArray[6]; row.Cells[8].Value = dt.getJazyk(Convert.ToInt32(dr.ItemArray[7])).Rows[0].ItemArray[1]; row.Cells[9].Value = this.GetBodyZaStitek(Convert.ToInt32(dr.ItemArray[3]), Convert.ToInt32(dr.ItemArray[7]), Convert.ToDouble(dr.ItemArray[5])); if (dr.ItemArray[1].ToString() != string.Empty) { row.Cells[2].Value = dt.getZamestnanecJmeno(Convert.ToInt32(dr.ItemArray[1])); } dataGridView_Stitek.Rows.Add(row); } }