Пример #1
0
        public static SimpleDataSet CreateData()
        {
            SimpleDataSet ds    = new SimpleDataSet();
            DataTable     table = ds.Tables["table"];

            Random rnd = new Random(DateTime.Now.Millisecond);

            for (int i = 0; i < 100; i++)
            {
                table.Rows.Add(new object[] { i, DateTime.Today.AddDays(1), (i % 2 == 0 ? "A" : "B"), Math.Round(rnd.NextDouble() * 100, 2) });
            }

            return(ds);
        }
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     listView1.DataContext = SimpleDataSet.CreateData().Tables[0];
 }