Migrate from GridTreeControl to SfTreeGrid

18 Jun 20242 minutes to read

To facilitate the migration from GridTreeControl to SfTreeGrid, aimed at integrating drag-and-drop, filtering, and sorting capabilities into the GanttGrid, this transition results in the breaking of certain APIs and the introduction of new ones. Please find the differences in the following topics.

Assembly references

Removed assemblies Added assemblies
Syncfusion.Grid.WPF
Syncfusion.GridCommon.WPF
Syncfusion.SfGrid.WPF
Syncfusion.SfSkinManager.WPF
Syncfusion.Themes.MaterialLight.WPF

Namespace

Removed namespaces Added namespace
Syncfusion.Windows.Controls.Gantt.Grid
Syncfusion.Windows.Controls.Gantt.Schedule
Syncfusion.Windows.Controls.Gantt.Chart
Syncfusion.Windows.Controls.Gantt

GanttGrid class API breaking

Class

Class Name Existing base class New base class

GanttGrid

GridTreeControl

SfTreeGrid

Properties

Existing API type Existing API name New API type New API Name
ObservableCollection(GridTreeColumn)

Columns

TreeGridColumns

Columns

GridTreeStartUpExpandState

ExpandStateAtStartUp

AutoExpandMode

AutoExpandMode

bool

ReadOnly

bool

IsReadOnly

GridSelectedTreeNodes

SelectedNodes

ObservableCollection(object)

SelectedItems

Methods

Existing method New method

CollapseAllNodes(GridTreeNode n)

CollapseAllNodes(TreeNode treeNode)

ExpandAllNodes(GridTreeNode n)

ExpandAllNodes(TreeNode treeNode)

Events

Existing structure Existing name New structure New name

GridTreeNodeEventArgs

ExpandStateChanged

NodeExpandedEventArgs


NodeCollapsedEventArgs

NodeExpanded


NodeCollapsed

GridTreeNodeCancelEventHandler

ExpandStateChanging

NodeExpandingEventArgs


NodeCollapsingEventArgs

NodeExpanding


NodeCollapsing

SyncfusionRoutedEventArgs

ItemsSourceChanged

EventHandler(TreeGridItemsSourceChangedEventArgs)

ItemsSourceChanged

Enums

Existing name Existing members New name New members

GridSelectionMode

MouseMove
MouseClick

SelectionMode

None
Single
Multiple

GridTreeNodeActions

Expanding
Expanded
Collapsing
Collapsed
Selecting
Unselecting

AutoExpandMode

None
RootNodesExpanded
AllNodesExpanded

VisualStyle

Office 2010 Blue Style
Office2010Blue
Office2010Black
Office2010Silver
Metro
Blend
VS2010
Nil Nil

Column types

GridTreeControl SfTreeGrid

GridTreeColumn

TreeGridTextColumn


TreeGridComboBoxColumn


TreeGridCurrencyColumn


TreeGridDateTimeColumn


TreeGridHyperlinkColumn


TreeGridMaskColumn


TreeGridNumericColumn


TreeGridPercentColumn


TreeGridCheckBoxColumn


TreeGridTemplateColumn

Removed public classes

Class name Base class

PredecessorCellRenderer

GridCellTextBoxRenderer

PredecessorCellModel

GridCellModel(PredecessorCellRenderer)

ResourceCellRenderer

GridCellTextBoxRenderer

ResourceCellModel

GridCellModel(ResourceCellRenderer)

VisualStyle

Enum

GridSelectionMode

Enum

Removed theme

  • Blend
  • Metro
  • Office2010Black
  • Office2010Silver
  • VS2010

Removed API

Class name Property type Property name

GanttControl

VisualStyle

VisualStyle

Access type changed classes

Class name Base class Existing access type Changed access type
CollectionToStringConverter IValueConverter internal public
BoolToVisibilityConverter IValueConverter internal public

Newly added APIs

Properties

Name Type Default value Summary
AllowDragDrop bool true Gets or sets a value indicating whether to allow the nodes reordering in Gantt.
AutoExpandMode GanttAutoExpandMode AllNodesExpanded Gets or sets the value which indicates how the nodes to be expanded while loading.
AllowSorting bool false Gets or sets a value indicating whether to allow sorting of records in Gantt.
AllowFiltering bool false Gets or sets a value indicating whether to allow filtering of records in Gantt.

Events

Event name EventArg name Summary
TreeGridNodeDragStarting TreeGridNodeDragStartingEventArgs Provides data for the TreeGridNodeDragStarting event, which occurs when an item is to be dragged.
TreeGridNodeDragging TreeGridNodeDraggingEventArgs Provides data for the TreeGridNodeDragging event, which occurs when an item is being dragged over the GanttControl.
TreeGridNodeDrop TreeGridNodeDropEventArgs Provides data for the TreeGridNodeDrop event, which occurs when an item to be dropped within GanttControl.
SelectionChanging SelectionChangingEventArgs Occurs when the selection is being changed in the Gantt.
SelectionChanged SelectionChangedEventArgs Occurs when the selection is changed in the Gantt.

Gantt.MVVM.WPF

To make the migration from GridTreeControl to SfTreeGrid, integrating drag-and-drop, filtering, and sorting into the Gantt grid, this transition breaks certain APIs and introduces new ones. Please find the differences in the following topics.

Assembly references

Removed assemblies Added assemblies
Syncfusion.Grid.WPF
Syncfusion.GridCommon.WPF
Syncfusion.SfGrid.WPF

Alternate events

GridTreeControl Structure GridTreeControl - Event name SfTreeGrid Structure SfTreeGrid - Event name Summary

GridTreeRequestTreeItemsEventArgs

RequestTreeItems

TreeGridRequestTreeItemsEventArgs

RequestTreeItems

This event is used to request an IEnumerable object that holds the child item objects for a particular parent item in on demand loading.

SyncfusionRoutedEventArgs

ItemsSourceChanged

TreeGridItemsSourceChangedEventArgs

ItemsSourceChanged

Occurs when the ItemsSource changed.

GridTreeNodeCancelEventArgs

ExpandStateChanging

NodeExpandingEventArgs


NodeCollapsingEventArgs

NodeExpanding


NodeCollapsing

Occurs when the node is being expanded or collapsed.

GridTreeNodeEventArgs

ExpandStateChanged

NodeExpandedEventArgs


NodeCollapsedEventArgs

NodeExpanded


NodeCollapsed

Occurs after the node is expanded or collapsed.

Alternate commands

ExpandStateChanging

GridTreeControl commands SfTreeGrid commands
GanttGridExpandStateChangingCommandBehaviorWithEventArgs GanttGridNodeExpandingCommandBehaviorWithEventArgs
GanttGridNodeCollapsingCommandBehaviorWithEventArgs
GanttGridExpandStateChangingCommandWithEventArgs GanttGridNodeExpandingCommandWithEventArgs
GanttGridNodeCollapsingCommandWithEventArgs
GanttGridExpandStateChangingCommandBehavior GanttGridNodeExpandingCommandBehavior
GanttGridNodeCollapsingCommandBehavior
GanttGridExpandStateChangingCommand GanttGridNodeExpandingCommand
GanttGridNodeCollapsingCommand
GanttGridExpandStateChangingCommandBehavior GanttGridNodeExpandingCommandBehavior
GanttGridNodeCollapsingCommandBehavior
GanttGridExpandStateChangingCommand GanttGridNodeExpandingCommand
GanttGridNodeCollapsingCommand

ExpandStateChanged

GridTreeControl commands SfTreeGrid commands
GanttGridExpandStateChangedCommandBehaviorWithEventArg GanttGridNodeExpandedCommandBehaviorWithEventArg
GanttGridNodeCollapsedCommandBehaviorWithEventArgs
GanttGridExpandStateChangedCommandWithEventArgs GanttGridNodeExpandedCommandWithEventArgs
GanttGridNodeCollapsedCommandWithEventArgs
GanttGridExpandStateChangedCommandBehavior GanttGridNodeExpandedCommandBehavior
GanttGridNodeCollapsedCommandbehavior
GanttGridExpandStateChangedCommand GanttGridNodeExpandStateChangedCommand
GanttGridNodeCollapsedCommand
GanttGridExpandStateChangedCommandBehavior GanttGridNodeExpandedCommandBehavior
GanttGridNodeCollapsedCommandbehavior
GanttGridExpandStateChangedCommand GanttGridNodeExpandedCommand
GanttGridNodeCollapsedCommand

Deprecated events

These events are deprecated. The GridTreeControl has been replaced by the SfTreeGrid in the GanttControl.

Structure Event name Summary
EventHandler

NodesPopulated

Occurs after the nodes are populated in the Grid.
EventHandler

RequestNodeImage

This event is used to request an image for the specified node item. This event is only raised if SupportNodeImages is true.

EventHandler< GridTreeCreatingNodeEventArgs>

CreatingTreeNode

Event which is raised as GridTreeNodes are created so derived tree nodes can be used.

EventHandler< SyncfusionRoutedEventArgs>

ParentPropertyNameChanged

Occurs when ParentPropertyName are being changed.

EventHandler< SyncfusionRoutedEventArgs>

ChildPropertyNameChanged

Occurs when ChildPropertyName are being changed.