コード例 #1
0
 /// <summary>
 /// The SetUpBatteryColumns.
 /// </summary>
 private void SetUpBatteryColumns()
 {
     //create 10 ICollectionViews for the columns
     //at first, put all elements in the first column
     for (int i = 0; i < 10; i++)
     {
         ICollectionView tmpView = new AutoUpdatingCollectionView(BatteryGridItemSource);
         if (i == 0)
         {
             tmpView.Filter = TrueFilter;
         }
         else
         {
             tmpView.Filter = FalseFilter;
         }
         tmpView.Refresh();
         GridViews.Add(tmpView);
     }
 }
コード例 #2
0
        public MainWindow()
        {
            InitializeComponent();

            List <object> myData = new List <object>()
            {
                new { Id = 1, Name = "John" },
                new { Id = 2, Name = "Mary" },
                new { Id = 3, Name = "Anna" },
            };

            GridViews.Add(new MyGrid {
                Data = myData
            });
            GridViews.Add(new MyGrid {
                Data = myData
            });
            GridViews.Add(new MyGrid {
                Data = myData
            });

            DataContext = this;
        }