10921 : Is it possible to have the root node point to one table and the sub node point to a different table. These are nodes on a grid of the gantt chart

Question

Is it possible to have the root node point to one table and the sub node point to a different table. These are nodes on a grid of the gantt chart

Answer

This is a very good question. Since each SubNode collection has its own datasource property you can easily bind to a different table, but what if the new table does not share the field definitions of the root table?

For each row we will look on the columns to see what field to use for each column.

So we need a way to override the fields used for the subnodes that comes from another table.

To do this you use the GridNode.NodeDataConnect.ColumnToFieldMapperHash explained like this in the help file:

Set columnToFieldMapperHashUse to true if you want to provide your own ColumnToFieldMapperHash different from the one specified in GridColumn.DataSourceColumn. This is likely what you want to do if you have different definitions on the dataviews on subnodes than the definition on the rootnodes. Add mapping with ColumnToFieldMapperHash.Add(“GridColumn.DataSourceColumn name”,”Name of field in dataview”) Note: if ColumnToFieldMapperHashUse=false the ColumnToFieldMapperHash is ignored