Retrieve height of the header gantt grid

Hi,

is there the possiblility to obtain the Height of the header of gantt grid?

Best Regards
Gian Piero Truccolo

3 Replies 1 reply marked as answer

RS Ramya Soundar Rajan Syncfusion Team March 22, 2021 12:43 PM UTC

Hi Gian, 
 
Greetings from Syncfusion. 
 
We would like to let you know that you can achieve this requirement by using the RowHeights property of the GridTreeModel as like in the below code snippet. 
 
    
     … 
 
     button.Click += Button_Click;    
      … 
 
        private void Button_Click(object sender, RoutedEventArgs e) 
       
            // To get the height of the gantt grid header. 
            var headerHeight = ganttControl.GanttGrid.Model.RowHeights[0]; 
       
 
Please let us know, if you need any further assistance. 
 
Regards, 
Ramya S 


Marked as answer

GI Gian March 22, 2021 02:54 PM UTC

Hi,

thanks, is it possible also to set the height?

Best regards
Gian Piero Truccolo


SS Sridevi Sivakumar Syncfusion Team March 23, 2021 01:16 PM UTC

Hi Gian Piero Truccolo,

We would like to inform you that, you can customize the GantGrird height by setting the expected row height value in the  Gantt.GanttGrid.Model.RowHeights[0] property in the GanttGrid loaded event as per the below code snippet.

[XAML]:
 
    <sync:GanttControl x:Name="Gantt"  Loaded="Gantt_Loaded" 
                               ItemsSource="{Binding TaskCollection}" 
                               UseAutoUpdateHierarchy="False" 
                                VisualStyle="Metro"> 
   ... 
        </sync:GanttControl> 

[C#]: 
        private void Gantt_Loaded(object sender, RoutedEventArgs e) 
        { 
            Gantt.GanttGrid.Loaded += GanttGrid_Loaded; 
       } 
  
        private void GanttGrid_Loaded(object sender, RoutedEventArgs e) 
        { 
            Gantt.GanttGrid.Model.RowHeights[0] = 200; 
        } 

Please have a sample from below link
https://www.syncfusion.com/downloads/support/forum/163671/ze/Sample-1484659401

Let us know if you need any further assistance.

Regards,
Sridevi S.
 


Loader.
Up arrow icon