Hi,
I want to assign some calculated values to scrollbar's offset of GanttChart view but cann't do that. There are couple of gantt tasks that have default Start and End values:
In this cases if user selects this ganttTask on the ColumnsPanel, the horizontal scrollbar of EventsPanel moves to the start of GanttChart's VisibleRange. I suppose it tries to show me that task via scrolling to its Start date. But this is not what I need. I want the horizontal scrollbar to stay at the same position as it was before selection. To achieve this I've binded a SelectedItem property to a view model's property and when it is changed I assign another horizontal offset value :
Here, the EventsPanel is a view model's property that referens to the GanttView's EventsPanel property. And this approach doesn't work for me. The scrollbar moves to the start of VisibleRange. I wonder is there a way to set the horizontal offset for the selected gantt task?
Thanks any help.
Kind regards,
Natalia Novosad
I want to assign some calculated values to scrollbar's offset of GanttChart view but cann't do that. There are couple of gantt tasks that have default Start and End values:
ganttTask.Start = DateTime.MinValue;
ganttTask.End = DateTime.MinValue;
In this cases if user selects this ganttTask on the ColumnsPanel, the horizontal scrollbar of EventsPanel moves to the start of GanttChart's VisibleRange. I suppose it tries to show me that task via scrolling to its Start date. But this is not what I need. I want the horizontal scrollbar to stay at the same position as it was before selection. To achieve this I've binded a SelectedItem property to a view model's property and when it is changed I assign another horizontal offset value :
public
ScheduleItem SelectedItem
{
get
{
return
_selectedItem;
}
set
{
_selectedItem = value;
// SomeType : IGanttTask and for all items of SomeType the next comes true:
//Start = DateTime.MinValue;
// End = DateTime.MinValue;
if
(_selectedItem
is
SomeType)
{
EventsPanel.HorizontalOffset = HorisontalPannelOffset;
}
RaisePropertyChanged(() => SelectedItem);
}
}
Thanks any help.
Kind regards,
Natalia Novosad