Guest User

Untitled

a guest
Jul 19th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. InitializeComponent();
  2. dataGridView1.Rows.Add(21);
  3. for (int i = 0; i < 21; i++)
  4. dataGridView1.Rows[i].Cells[0].Value = degree [i]`
  5.  
  6. using System.Windows.Data; // for table
  7.  
  8. public MainWindow()
  9. {
  10. InitializeComponent();
  11. DataTable dt= new DataTable();
  12. dt.Columns.Add("Header name");
  13.  
  14. for (int i = 0; i < degree.Length; i++)
  15. dt.Rows.Add(degree[i]);
  16.  
  17. DG.ItemsSource = dt.DefaultView; // DG - имя DataGrid, в который помещаю DataTable.
  18. }
Add Comment
Please, Sign In to add comment