public Form1()
        {
            InitializeComponent();

            _calcEngine            = new C1CalcEngine(new VBAEngine());
            c1FlexGrid1.DataSource = _calcEngine.DataSource = new Prod[]
            {
                new Prod {
                    Product = "Chai", Qnt = 18, Price = 18.1
                },
                new Prod {
                    Product = "Pavlova", Qnt = 11, Price = 17.45
                },
                new Prod {
                    Product = "Sir Rodney's Marmalade", Qnt = 1, Price = 40
                },
                new Prod {
                    Product = "Ipoh Coffee", Qnt = 10, Price = 14.0
                },
                new Prod {
                    Product = "Mascarpone Fabioli", Qnt = 16, Price = 32.0
                },
                new Prod {
                    Product = "Schoggi Schokolade", Qnt = 12, Price = 43.9
                },
            };
        }
Example #2
0
        public ExcelEngineDemo()
        {
            InitializeComponent();

            // Create C1CalcEngine instance with ExcelEngine
            _calcEngine = new C1CalcEngine(new ExcelEngine());

            // Set data source for the first grid.
            var data1 = GetDataTable("Sheet1");

            sheet1.DataSource = data1;
            for (int i = 1; i <= 80; i++)
            {
                sheet1.Rows[i][0] = i;
            }
            sheet1.AutoSizeCol(0);

            // Configure the second grid.
            LoadUnboundGrid(sheet2);

            // Set engine data source.
            _calcEngine.DataSource = new List <IDataSheet> {
                data1, sheet2
            };

            // Select some cells.
            this.sheet1.Select(1, 1, 2, 2);
            sheet2.Select(3, 2, 5, 3);
        }
        public Form1()
        {
            InitializeComponent();
            _calcEngine = new C1CalcEngine(new ExcelEngine());
            var sheet1 = GetDataTable("Sheet1");

            c1FlexGrid1.DataSource = sheet1;
            for (int i = 1; i <= 80; i++)
            {
                c1FlexGrid1.Rows[i][0] = i;
            }
            c1FlexGrid1.AutoSizeCol(0);
            LoadUnboundGrid(sheet2);
            sheet2.AutoSizeCol(0);
            _calcEngine.DataSource = new List <IDataSheet> {
                sheet1, sheet2
            };
            c1FlexGrid1.Select(1, 1, 2, 2);
            sheet2.Select(3, 2, 5, 3);
        }