GanttView ResizeBehavior

4 posts, 0 answers
  1. CreoniX
    CreoniX avatar
    28 posts
    Member since:
    Sep 2009

    Posted 07 Apr Link to this post

    hi,

    I tried to trigger the event ResizeCompleted on a Custom ganttask. 

    I found in the telerik manual (http://docs.telerik.com/devtools/wpf/controls/radganttview/features/drag-and-drop/dragdrop-custom-behaviors.html) the following event : ResizeCompleted(SchedulingResizeState state) – occurs when the resize operation has finished

     

    When I try to use it in code, I got it like in the picture! It can't find the override event like explained in the manual. 

     

     

    Note: Using version '2015.2.728.40'

  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 08 Apr Link to this post

    Hi Marnix,

    Indeed, such an event is not raised inside the ResizeBehavior of GanttView - it seems there was some miscommunication on our side regarding this topic.

    Please take our apology for misleading you, I will make sure to update the documentation right away.
    I have also updated your points for bringing this to our attention.

    Could you explain the required scenario with RadGanttView in more details, so we could check whether there is another way to achieve it?

    I am looking forward to your reply.

    Regards,
    Yana
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. UI for WPF is Visual Studio 2017 Ready
  4. CreoniX
    CreoniX avatar
    28 posts
    Member since:
    Sep 2009

    Posted 22 Apr Link to this post

    Hi,

    So we want to resize the elements in a GanttView. (See picture one).

    We are using a Custom GanttTask class to show the Tasks (Orders and Operation, 2 different tables in DB)

    public class SchedulingGanttTask : GanttTask
      {
          public string Type { get; set; } //Operation Or Order
          public Guid ID { get; set; } //TaskID Or ODMTID
          public TblDatODMT Order { get; set; } //Order
          public TblDatTask Operation { get; set; } //Operation
          public string ShortName { get; set; } //Voor Beide
          public string ShortDesc { get; set; } //Voor Beide
          public string LongDesc { get; set; } //Voor Beide
     
          public TblLstStatus Status { get; set; } //Zowel voor Task als Order
          public string SystemStatus { get; set; } //Zowel voor Task als Order
          public TblLstOrganisation RespOrganisation { get; set; } // WorkCenter, zowel nodig voor Operation als Order
          public TblLstPriority Priority { get; set; } //Enkel voor Order, Operation heeft geen priority
          public TblLstLocation Location { get; set; } //Voor Beide
          public TblLstEquipment Equipment { get; set; } //Voor Beide
     
          public DateTime PlannedStart { get; set; } //Voor Beide
          public DateTime PlannedEnd { get; set; } //Voor Beide
          public DateTime? OrderStart { get; set; } //Enkel voor Order
          public DateTime? OrderEnd { get; set; } //Enkel voor Order
          public DateTime? RealStart { get; set; } //Voor Beide
          public DateTime? RealEnd { get; set; } //Voor Beide
          public DateTime? DueDate { get; set; } //Voor Beide
     
          public string ERPCode { get; set; } //Voor Beide
     
          public TblLstTaskType TaskType { get; set; } //Enkel voor Operation
          public TblLstActivity Activity { get; set; } //Enkel voor Operation
          public int? CountPersons { get; set; }
      }

     

    After resize and after dragdrop, we went to Save the data immediately in the DB. Because the data is first changing in the custom class, we need a Completed event for the resize. So we can update the value in the DB.

     There is already code available when changing the date using a DatePicker. This code should also be triggered when the resize is completed.

    public void dtp_SelectionChanged(object sender, SelectionChangedEventArgs e)
            {
                RadDateTimePicker dtPicker = sender as RadDateTimePicker;
     
                var x = dtPicker.DataContext;
     
                SchedulingGanttTask dpGanttObject = ((SchedulingGanttTask)dtPicker.DataContext);
     
                if (dpGanttObject.Type.ToLower() == "Operation".ToLower())
                {
                    if (dtPicker.Name.ToString() == "Start")
                    {
                        dpGanttObject.Operation.PlannedStart = dtPicker.SelectedValue.Value;
                        //Checken op we order START/END ook moeten aanpassen
                        if (dpGanttObject.Operation.PlannedStart < dpGanttObject.Order.PlannedStart) //Indien operationStart < orderStart
                            dpGanttObject.Order.PlannedStart = dpGanttObject.Operation.PlannedStart;
                    }
     
                    if (dtPicker.Name.ToString() == "End")
                    {
                        dpGanttObject.Operation.PlannedEnd = dtPicker.SelectedValue.Value;
                        //Checken op we order START/END ook moeten aanpassen
                        if (dpGanttObject.Operation.PlannedEnd > dpGanttObject.Order.PlannedEnd)           //Indien operationEnd > orderEnd
                            dpGanttObject.Order.PlannedEnd = dpGanttObject.Operation.PlannedEnd;
                    }
                }
                else
                {
                    if (dtPicker.Name.ToString() == "Start")
                        dpGanttObject.Order.PlannedStart = dtPicker.SelectedValue.Value;
     
                    if (dtPicker.Name.ToString() == "End")
                        dpGanttObject.Order.PlannedEnd = dtPicker.SelectedValue.Value;    
                }
            }

  5. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 26 Apr Link to this post

    Hello Marnix,

    I am sorry for the delayed reply.

    In this case I'd suggest you use TaskEdited event of the GanttView as it is raised when a task property is updated through the UI - it will be fired after resize, dragdrop as well as editing in the Grid part of the control.

    Please try it and let us know whether it's suitable to you.

    Regards,
    Yana
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top