private void Button1_Click(object sender, EventArgs e) { int[,,] a = new int[5, 5, 10]; a[0, 0, 0] = 10; a[0, 1, 1] = 20; tabControl1.TabPages.Clear(); for (int i = 0; i < a.GetLength(0); i++) { TabPage page = new TabPage(); page.Text = "Stranka " + i; tabControl1.TabPages.Add(page); DataGridView grid = new DataGridView(); // stranku vyplnit tabulkou page.Controls.Add(grid); grid.Dock = DockStyle.Fill; int n = a.GetLength(2); // pocet sloupcu for (int k = 0; k < n; k++) { var column = new DataGridViewTextBoxColumn(); column.HeaderText = "Sloupec " + k; grid.Columns.Add(column); // pridat sloupec } int m = a.GetLength(1); // pocet radek for (int j = 0; j < m; j++) // cyklus pro radky { string[] txt = new string[n]; // textove pole pro jednu radku for (int k = 0; k < n; k++) // cyklus pro sloupce { txt[k] = "" + a[i, j, k]; } grid.Rows.Add(txt); // pridat radku } } }