示例#1
0
        private void LoadToDos()
        {
            this.todos.Children.Clear();

            using (ToDos toDos = this.core.GetToDos(this.cosplan.Nummer))
            {
                int kategorie   = 0;
                int columnCount = 9;
                //hier "Tabellenkoepfe" fuer Kategorien einfuegen
                while (!toDos.EoF)
                {
                    if (kategorie != toDos.Kategorie_Nr)
                    {
                        kategorie = toDos.Kategorie_Nr;

                        Grid header = new Grid
                        {
                            Background = Brushes.Transparent,
                            Height     = 20
                        };

                        for (int i = 0; i <= columnCount; i++)
                        {
                            header.ColumnDefinitions.Add(new ColumnDefinition());
                        }
                        this.CreateTableHeader(header, kategorie);
                        this.todos.Children.Add(header);
                    }
                    GridExtended grid = new GridExtended
                    {
                        Background = Brushes.Transparent,
                        Height     = 50
                    };
                    grid.MouseEnter    += Grid_MouseEnter;
                    grid.MouseLeave    += Grid_MouseLeave;
                    grid.MouseUp       += Grid_MouseUp;
                    grid.EditCompleted += Grid_EditCompleted;

                    for (int i = 0; i <= columnCount; i++)
                    {
                        grid.ColumnDefinitions.Add(new ColumnDefinition());
                    }

                    this.ActualizeSingleToDoRow(grid, toDos);

                    this.todos.Children.Add(grid);
                    toDos.Skip();
                }
            }
        }