public void SetBacklogs(IEnumerable<Task> tasks, ITaskAddableControl taskAddable) { foreach (var mitem in tasks.GroupBy(t => new { t.BacklogId, t.Backlog.Name, t.TypeId, AssignedTo = t.AssignedToId.GetValueOrDefault(0) })) { var mc = CreateBacklogControl(mitem.Key.BacklogId, mitem.Key.AssignedTo, mitem.Key.Name, mitem.Key.TypeId); taskAddable.AddBackLog(UserId, mitem.Key.BacklogId); mc.Height = taskAddable.AddTasks(mitem, mitem.Key.BacklogId, mitem.Key.AssignedTo); pnlBacklogs.Controls.Add(mc); } }