Example #1
0
        protected void LoadFromDB()
        {
            var adapter = new SheetDataTableAdapters.SheetAdapter();
            var cache = new SheetDataTableAdapters.CachesAdapter();

            bigGrid1.Items.Clear();
            var table = adapter.GetSheet();
            foreach (var cell in table) {
                var gc = new GridCell {Formula = cell.Formula, Name = cell.Name};
                int x = cell.x;
                int y = cell.y;

                var ctab = cache.GetCacheByHash((long)bigGrid1.Items.GetUniqueKey(x, y));
                if (ctab.Count > 0) {
                    gc.Value = ctab[0].Value;
                    gc.RPN = ctab[0].RPN;
                }

                bigGrid1.Items[x, y] = gc;
            }
        }