March 27, 2025, 11:44:04 PM

See more Support incidents in our old archived forum.

Author Topic: MaxOverlappingBlocksRowCount always returns 1  (Read 4498 times)

tim

  • Customers
  • Jr. Member
  • *
  • Posts: 60
MaxOverlappingBlocksRowCount always returns 1
« on: October 29, 2020, 03:48:33 PM »
Hello,

we have a FlexyGantt with OverlappedTasksRenderingOptimization="ShrinkHeight" and a RowHeigtConverter. So if some tasks overlap the row height increases.
The user can collapse a row of the gantt via a toggle button.
To do this, TaskListBinding is bound to a CollectionView of the task items and the CollectionView filters all tasks out, resulting in MaxOverlappingBlocksRowCount set to 1.

The problem is that when the user expands the row MaxOverlappingBlocksRowCount is still 1 and the row cannot be calculated with the correct height.

I looked into the code and when the filter of the CollectionView is changed the event OnItemsChanged() in ChartChildren class is fired.

Code: [Select]
else if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Reset)
{
    this.blocks.Clear();
}
this.UpdateMaxOverlappingTasksCount();

When this.UpdateMaxOverlappingTasksCount() is called, this.blocks is empty and results in MaxOverlappingBlocksRowCount set to 1. The same action is fired when the filter repopulates the CollectionView.

The Microsoft documentation for NotifyCollectionChangedAction.Reset states:
"The contents of the collection changed dramatically."
This means that a large change occurred in the collection and it should be reevaluated completely. This can be a Clear() but it can also be a changing filter.

For a test I added the items again (e.NewItems is null in this case):
Code: [Select]
else if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Reset)
{
    this.blocks.Clear();

    //test: readd items
    if (tasksPanel != null)
    {
        foreach (TaskItemControl child in tasksPanel.Children)
            this.OnNewEntityAdded(child);
    }
}

This solved my issue, all items get added again when the filter adds them.
Would be great if you could include this fix.

Best regards
« Last Edit: February 15, 2021, 01:14:21 PM by jan.reker »

Rajagopal

  • RQ Members
  • Full Member
  • *
  • Posts: 182
Re: MaxOverlappingBlocksRowCount always returns 1
« Reply #1 on: November 03, 2020, 06:14:52 PM »
Jan,

Thank you for your suggestion. We will consider your changes.

Thanks,
Raja.

tim

  • Customers
  • Jr. Member
  • *
  • Posts: 60
Re: MaxOverlappingBlocksRowCount always returns 1
« Reply #2 on: November 04, 2020, 05:17:19 PM »
Raja,

Thank you for the reply.
Please let me know, when the issue is fixed. We need it urgently.

Best regards

Rajagopal

  • RQ Members
  • Full Member
  • *
  • Posts: 182
Re: MaxOverlappingBlocksRowCount always returns 1
« Reply #3 on: November 16, 2020, 12:35:26 PM »
Jan,

The suggested code changes looks good but we are wondering when these changes might require. We are trying to reproduce the scenario, unfortunately we couldn't. Can you share the reference sample it will speed up the process.

Thanks,
Raja.

tim

  • Customers
  • Jr. Member
  • *
  • Posts: 60
Re: MaxOverlappingBlocksRowCount always returns 1
« Reply #4 on: November 23, 2020, 11:29:08 AM »
Raja,

I sent a link to a sample project on friday to support@radiantq.com.

Best regards

Rajagopal

  • RQ Members
  • Full Member
  • *
  • Posts: 182
Re: MaxOverlappingBlocksRowCount always returns 1
« Reply #5 on: November 23, 2020, 07:14:08 PM »
Jan,

We got your sample and we are concerned with the performance by including your changes. Anyway, we will test it thoroughly and provide you an update soon.

tim

  • Customers
  • Jr. Member
  • *
  • Posts: 60
Re: MaxOverlappingBlocksRowCount always returns 1
« Reply #6 on: November 24, 2020, 10:19:27 AM »
Raja,

thanks for the reply.
If performance of my change is an issue, maybe you can find a different way to fix it.

Best regards

Rajagopal

  • RQ Members
  • Full Member
  • *
  • Posts: 182
Re: MaxOverlappingBlocksRowCount always returns 1
« Reply #7 on: December 04, 2020, 01:37:58 PM »
Jan,

We are making slow but steady progress, will keep you updated.

tim

  • Customers
  • Jr. Member
  • *
  • Posts: 60
Re: MaxOverlappingBlocksRowCount always returns 1
« Reply #8 on: January 04, 2021, 12:52:55 PM »
Hello,

it's been nine weeks now since the initial post and four weeks since the last update :-( and we urgently need some improvement on this. We need a solution or at least a plan within the coming week.

Best regards
Jan

Rajagopal

  • RQ Members
  • Full Member
  • *
  • Posts: 182
Re: MaxOverlappingBlocksRowCount always returns 1
« Reply #9 on: January 05, 2021, 02:31:37 PM »
Hi Jan,

Due to Christmas and NewYear holidays delay is unavoidable. As we said earlier we made slow but steady progress and handled the scenario of refreshing(Filter) task view items. Currently, testing is on progress. We have to test thoroughly since the changes are in source level.

Hope you will get an updated version within a day or two.

Thanks
Raja

Rajagopal

  • RQ Members
  • Full Member
  • *
  • Posts: 182
Re: MaxOverlappingBlocksRowCount always returns 1
« Reply #10 on: January 08, 2021, 03:17:27 AM »
Hi Jan,

We have sent you the latest assembly to you in email. Please get it and let us know the status.

tim

  • Customers
  • Jr. Member
  • *
  • Posts: 60
Re: MaxOverlappingBlocksRowCount always returns 1
« Reply #11 on: January 08, 2021, 11:14:35 AM »
Raja,

we got the latest assembly and the issue is gone :)
Thank you.

Please also send uns the source code and samples for the latest version.

Best regards