private void addItem(TEItem te, int column) { ItemInMainGrid grid = new ItemInMainGrid(); grid.AddOnClickHandler((e, a) => { TEWindow window = new TEWindow(te); window.ShowDialog(); }); grid.LeftText = te.getTitle(); grid.RightText = DateUtil.CZ_SHORT_DATE_FORMAT.format(te.getDate()); if (column == 1) { examsColumnView.Children.Add(grid); } else { tasksColumnView.Children.Add(grid); } }