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'
3 Answers, 1 is accepted
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
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;
}
}
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