Posted 24 January 2019, 3:42 am EST - Updated 4 October 2022, 1:38 am EST
GanttView collapse groups on load
Posted by: jay on 24 January 2019, 3:42 am EST
-
-
Posted 25 January 2019, 1:34 am EST
Hi Jay,
You can use this method to collapse all the groups:
private void CollapseGroupTasks() { var flex = c1GanttView1.Controls[2] as C1.Win.C1FlexGrid.C1FlexGrid; for (int row = 0; row < flex.Rows.Count; ++row) { var dataSource = flex.Rows[row].DataSource; if (dataSource != null && dataSource.GetType().FullName.Equals("C1.Win.C1GanttView.GroupTask")) { var task = dataSource as C1.Win.C1GanttView.BaseTask; task.IsCollapsed = true; } } }
You can also refer to the attached sample for the same.
Regards,
Jitender -
Posted 25 January 2019, 4:56 am EST
Didn’t quite work in VB.net after conversion but with minor changes I was able to get it to work. Definitely pointed me in the right direction. I didn’t think about modifying it that way before. Thanks so much for your help.