April 18, 2024, 12:56:08 AM

See more Support incidents in our old archived forum.

Author Topic: Increase GanttChart row height in FlexyGantt  (Read 8087 times)

d.laumaille

  • Customers
  • Newbie
  • *
  • Posts: 21
Increase GanttChart row height in FlexyGantt
« on: January 13, 2017, 09:38:17 AM »
Hello,

in my flexygantt, I'd like to increase row height of a particular row of the chart, according to the height of its row in the table.
To do this, I wrote this code :
Code: [Select]
        private void FlexyTable_RowSizeChanged(object sender, SizeChangedEventArgs args)
        {
            var index = fxgRes.FlexyTable.GetRowIndex(sender as DataGridRow);
            if (fxgRes.GanttChart.RowControlsList.Count > index)
                fxgRes.GanttChart.RowControlsList.ToList()[index].Height = args.NewSize.Height;
        }

But it doesn't seem to be the right way to do this.

Could you help me ?


Rajagopal

  • RQ Members
  • Full Member
  • *
  • Posts: 182
Re: Increase GanttChart row height in FlexyGantt
« Reply #1 on: January 13, 2017, 06:29:52 PM »
d.laumaille,

We actually keep the heights in sync the other way - as the chart line's height changes, we change the grid row's height. So, what you do above might break things. Can you tell us what exactly you are trying to achieve? We will guide you in the right direction.

Thanks,
- Raja.

d.laumaille

  • Customers
  • Newbie
  • *
  • Posts: 21
Re: Increase GanttChart row height in FlexyGantt
« Reply #2 on: January 16, 2017, 08:19:54 AM »
Well I'm just trying to manage the row height in flexy gantt like in a software as MS Excel : on the row header, I click, hold and move down the mouse to increase the height of a row.

Rajagopal

  • RQ Members
  • Full Member
  • *
  • Posts: 182
Re: Increase GanttChart row height in FlexyGantt
« Reply #3 on: January 17, 2017, 01:32:53 PM »
So, it appears that you have implemented row height resizing (ability for the user to drag and resize) yourself, is that correct? If yes, could you tell us if you have any kind of "auto row sizing" turned on in FlexyGantt (like the overlapping feature) that would interfere with what you are trying to do. If no, then we will provide you a good solution for this.

Thanks,
- Raja.

d.laumaille

  • Customers
  • Newbie
  • *
  • Posts: 21
Re: Increase GanttChart row height in FlexyGantt
« Reply #4 on: January 18, 2017, 02:50:54 PM »
Hello Raja,

Yes, I implemented row height resizing myself, and my flexyGantt has a RowHeight property set to 20. The flexyTable also has a RowStyle with a MinHeightProperty set to 20, to prevent user to make a row disappear !
I don't see no "auto row sizing" turned on... The OverlappedTasksRenderingOptimization property is set to ShrinkHeight (which doesn't always work well by the way...).

Sinci my first post, I changed my code to this :
Code: [Select]
        private void FlexyTable_RowSizeChanged(object sender, SizeChangedEventArgs args)
        {
            var tmp = fxgRes.GanttChart.RowControlsList
                            .FirstOrDefault(c => c is RadiantQ.Windows.Controls.FlexyGantt.TasksListControl
                            && ((RadiantQ.Windows.Controls.FlexyGantt.TasksListControl)c).DataContext == ((DataGridRow)sender).Item);
            if (tmp != null) tmp.Height = args.NewSize.Height;
        }

But I'm sure you have a better way to implement this ! ^^

ForumAdmin

  • Administrator
  • Jr. Member
  • *****
  • Posts: 96
Re: Increase GanttChart row height in FlexyGantt
« Reply #5 on: January 19, 2017, 09:57:33 PM »
Daniel,

The trick here is that we should let the user to drag size the row, but actually let the gantt manage the row's height. So, could you modify one of our samples to show what exactly you have done so far, we will then modify it to handle this.

Thanks
Praveen

d.laumaille

  • Customers
  • Newbie
  • *
  • Posts: 21
Re: Increase GanttChart row height in FlexyGantt
« Reply #6 on: January 20, 2017, 09:24:10 AM »
Done !

There is not a lot of modifications... One important thing : I'm using RadiantQ v7.0.45.13. It's the last version I had...

You can download it there : http://download.ag2l.fr/AG2LMaj/DLM_Forum_RadiantQ/FlexyGanttFlatListSkeleton - RowSizing.zip

Thank you.

(And my name is David, not Daniel !  ;D)

Rajagopal

  • RQ Members
  • Full Member
  • *
  • Posts: 182
Re: Increase GanttChart row height in FlexyGantt
« Reply #7 on: January 23, 2017, 05:22:12 PM »
David,

There is a "GetRowVisualForItem" method in GanttChart to get the row by it's data. Here is the code to use it,

Code: [Select]
private void FlexyTable_RowSizeChanged(object sender, SizeChangedEventArgs args)
{
    // Checking for "parentPanel != null" is not necessary for WPF 8.0 release.
    Panel parentPanel = this.fxgantt.GanttChart.UseChartVirtualization ? this.fxgantt.GanttChart.VirtualizingPanel : this.fxgantt.GanttChart.NonVirtualizingPanel;
    if (parentPanel != null)
    {
        var tmp = this.fxgantt.GanttChart.GetRowVisualForItem(((DataGridRow)sender).Item);
        if (tmp != null) tmp.Height = args.NewSize.Height;
    }
}

Thanks,
- Raja.

d.laumaille

  • Customers
  • Newbie
  • *
  • Posts: 21
Re: Increase GanttChart row height in FlexyGantt
« Reply #8 on: January 24, 2017, 01:17:43 PM »
Hi Raja,

Thanks for the tip, it works great !

But where can I found the WPF 8.0 Release Package ? :-)

Rajagopal

  • RQ Members
  • Full Member
  • *
  • Posts: 182
Re: Increase GanttChart row height in FlexyGantt
« Reply #9 on: January 24, 2017, 07:19:04 PM »
David,

We are on progress of releasing WPF 8.0 version. Hopefully, you can get the update within a week or two. We will let you know after the official release.

Thanks,
- Raja.