Hide GanttGrid

Is there the possibility to keep  close GanttGrid?

Best regards
Gian Piero Truccolo

3 Replies 1 reply marked as answer

SS Sridevi Sivakumar Syncfusion Team March 8, 2021 09:25 AM UTC

Hi Gian Piero Truccolo,

Greetings from Syncfusion.

Query:  Is there the possibility to keep close GanttGrid?

Yes, we can hide the gantt grid by setting the GanttControl GridWidth property value to 0 as per below code snippet,

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

Screenshot:


Please have a sample from below link
 
https://www.syncfusion.com/downloads/support/forum/163227/ze/Sample1027333147

For more information about setting the width for GanttChart and GanttGrid   



GI Gian March 8, 2021 09:31 AM UTC

Hi,

this solution is not enough, because a user can see the splitter that allow expande gantt grid, so that the gantt grid can be visible.

We need to kepp always close  tha gantt grid not only at first initialization.

Best regards
Gian Piero Truccolo


SS Sridevi Sivakumar Syncfusion Team March 9, 2021 12:06 PM UTC

Hi Gian Piero Truccolo,

Query: We need to keep always close the Gantt grid not only at first initialization.

We would like to inform we don’t have direct support to hide gantt grid. So we have disabled the splitter by setting GridSplitter IsEnabled property to false in the Gantt Loaded event as per the below code snippet,
 
        private void Gantt_Loaded(object sender, RoutedEventArgs e) 
        { 
           var  splitter = this.Gantt.FindElementOfType<GridSplitter>(); 
            splitter.IsEnabled = false; 
        } 

Also set GridWidth property value to 0 as per below code snippet,

Code snippet[XAML]:  
    <sync:GanttControl x:Name="Gantt"  Loaded="Gantt_Loaded"  GridWidth="0" 
                               ItemsSource="{Binding TaskCollection}" 
                               UseAutoUpdateHierarchy="False" 
                                VisualStyle="Metro"> 
            <sync:GanttControl.TaskAttributeMapping> 
                <sync:TaskAttributeMapping TaskIdMapping="Id" 
                                                TaskNameMapping="Name" 
                                                StartDateMapping="StDate" 
                                                ChildMapping="ChildTask" 
                                                FinishDateMapping="EndDate" 
                                                DurationMapping="Duration" 
                                                ResourceInfoMapping="Resource" 
                                                ProgressMapping="Complete" 
                                                PredecessorMapping="Predecessor"/> 
            </sync:GanttControl.TaskAttributeMapping> 
        </sync:GanttControl> 

Please have a sample from the below link
https://www.syncfusion.com/downloads/support/forum/163227/ze/GanttSample694769585

Let us know if you need any further assistance.

Regards,
Sridevi S.
 


Marked as answer
Loader.
Up arrow icon