Hi
In a Gantt, I added custom columns, but I need to catch event when a user will change a value. How to do this ?
I don't find event :/
The same when the user modifies the End Date of a task in Timeline, can't we catch event ?
Hi,
I`m not sure what are your final goals, but maybe you could try one of these events:
private void ultraGanttView1_CellDeactivating(object sender, CellDeactivatingEventArgs e)
{
// You could check for a column`s key. For your custom columns, please verify that you set a Key property.
if (e.TaskFieldInfo.TaskFieldKey == "Duration")
Debug.WriteLine("AAAAA");
}
Another possible option could be:
private void ultraGanttView1_InitializeTaskGridRow(object sender, InitializeTaskGridRowEventArgs e)
// TO DO
This event will fire in both cases (when modify the task through the grid and through the timeline)
Let me know if you have any questions
I'll try to explain better.
I have custom columns : A and B.
If a user changes A value on a task. I want to change the Start/Finish Date. If the user changes the timeline (so the start/finish Date) I want to change the value for B.
to summarize :
A impacts Start Time.StartTime impacts B.
What event is fired when A value has changed ?What event is fired when Timeline has changed ?
I checked the sample from my previous response and I think that it works according your requirement:
If a user changes A value on a task. I want to change the Start/Finish Date.
If the user changes the timeline (so the start/finish Date) I want to change the value for B.
Maybe I didn`t understand well your task, but when you enter something in the CustomColumn_A - the Start and EndDate will change
When you move/resize the bar in the timeline the value for CustomColumn_B will change. But please note that your Start and End date of this task will change (by deisgn) and it is expected, otherwise you will have inconsistent data between information in the grid and their representation in the timeline.
Let me know if you have any questions.
HI thanks.
It s working fine for Custom column. But it doesn't work for timeLine change.All your events are fired on initializing. Just want an event on user changing !
Why doesn't create a real event DataChanged ?
Thanks for the details. Maybe you could try the code below:
private void ultraGanttView1_CellDeactivating(object sender, Infragistics.Win.UltraWinGanttView.CellDeactivatingEventArgs e)
// Check for custom column A
if (e.TaskFieldInfo.TaskFieldKey == "MyCustomColumn_A")
// change StartDate and Duration. Please note that you could change StartDate and Duration or EndDate and Duration. It is not possible to set StartDate and EndDate
e.TaskFieldInfo.Task.StartDateTime = e.TaskFieldInfo.Task.StartDateTime.AddDays(2);
e.TaskFieldInfo.Task.Duration = new TimeSpan(5, 0, 0, 0);
//SaveChangesInDataBase();
private void ultraGanttView1_InitializeTaskGridRow(object sender, Infragistics.Win.UltraWinGanttView.InitializeTaskGridRowEventArgs e)
if (e.ReInitialize && e.Task.EndDateTime == e.Task.EndDateTimeResolved.AddSeconds(1))
// Set value in Custom column B
e.Task.SetCustomProperty("MyCustomColumn_B", DateTime.Now.ToString());