Advertisement
Guest User

Untitled

a guest
Mar 27th, 2013
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.34 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Windows;
  6. using System.Windows.Controls;
  7. using System.Windows.Data;
  8. using System.Windows.Documents;
  9. using System.Windows.Input;
  10. using System.Windows.Media;
  11. using System.Windows.Media.Imaging;
  12. using System.Windows.Navigation;
  13. using System.Windows.Shapes;
  14. using System.Collections.ObjectModel;
  15.  
  16. namespace DemoDataGrid
  17. {
  18.     public class Row {
  19.  
  20.         public string Col1 { get; set;}
  21.         public string Col2 { get; set;}
  22.         public string Col3 { get; set;}
  23.  
  24.     }
  25.  
  26.     /// <summary>
  27.     /// Interaktionslogik für MainWindow.xaml
  28.     /// </summary>
  29.     public partial class MainWindow : Window
  30.     {
  31.         public MainWindow()
  32.         {
  33.             InitializeComponent();
  34.  
  35.             for (int i = 0; i < 10; i++)
  36.             {
  37.                 DataGridDS.Add(new Row
  38.                 {
  39.                     Col1 = "co asd asdfasd fasd fa sdf asd f asd fas df as fw qf wqe fqw efqwef qwef qwef qwef qwef l1 " + i,
  40.                     Col2 = "col2 " + i,
  41.                     Col3 = "col3 " + i,
  42.                 });
  43.             }
  44.         }
  45.  
  46.         private ObservableCollection<Row> _dataGridDS = new ObservableCollection<Row>();
  47.         public ObservableCollection<Row> DataGridDS { get { return _dataGridDS; } }
  48.     }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement