Beispiel #1
0
 void GRD_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
 {
     if (e.Control is DurationInputBoxEditingControl)
     {
         durationInputBox = GRD.EditingControl as DurationInputBox;
     }
 }
Beispiel #2
0
        void GRD_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            if (CurrentTask != null)
            {
                if (durationInputBox != null)
                {
                    durationInputBox.AutomaticDurationType = true;
                    durationInputBox.Duration = durationInputBox.Duration;
                    CurrentTask.DurationType = durationInputBox.DurationType;
                    CurrentTask.Duration = durationInputBox.Duration;
                    durationInputBox = null;
                }

                switch (GRD.Columns[e.ColumnIndex].Name)
                {
                    case "EndDate":
                        CurrentTask.EndEdit(false, GanttItem.TaskShiftModes.fromRight, true);
                        break;

                    case "StartDate":
                        CurrentTask.EndEdit(false, GanttItem.TaskShiftModes.fromLeft, true);
                        break;

                    case "Duration":
                        CurrentTask.EndEdit(false, GanttItem.TaskShiftModes.fromLeft, true);
                        break;

                    case "Identity":
                        // Синхронизация свойства Identity и проперти Identity
                        CurrentTask.SetProperty("Identity", CurrentTask.Identity);
                        break;
                }

                CurrentTask = null;
            }
        }