Hello,
in my new project i have to show two types of object in one tree. Each of the objecttypes must be shown in different subtees with his own root node.
Infragistics is able to show a "DataSource" via DataBinding.
For Example:
"ObjectQuery<WorkpiecesGroups> WorkpiecesGroupesQuery = workpieceContext.WorkpiecesGroups.Where("it.ParentWorkpiecesGroup is NULL"); this.ultraTreeRequirements.DataSource = WorkpiecesGroupesQuery.ToList();
It is possible to show the Data from two different Datasources?
For example with a "Datasource.Add' - Method? So that one root node with children is from datasource of Ado.Net dataSet and the other root node with children from datasource type of Ado.Net EntityFramework?
thanks and greatings: Rudi
Hi,
By default, the tree automatically generates the ColumnSet which defines the columns for the data. The ColumnSet created by the tree uses the TableName of the data source as the key of the ColumnSet.
My guess is that the two different EntityFramework objects that you are binding to are both using the same name (or possibly no name), so the tree is re-using the ColumnSet it generated for the first one on the second one. It assumes that if they have they same name, they are the same.
I'm not familiar enough with the EntityFramework to know where the names of the tables come from or if it is possible to change the name. You will need to check with Microsoft on that.
But another option is for you to manually create the ColumnSets yourself and assign them to the appropriate nodes.
Hi Mike,
thank you, it works a little bit...
But i have the problem, that the interfaces of EntityObjects ar not identical, so that always the columns of first subtree is shown. Is there the posssibility to show different columns in the same level of both subtrees? It works if I use a DataSet without setting a special DataMember. In this case for all Subtrees of each Datamember the different ColumnSet is shown.
Since I use a EntityObject (Query) as Data Source i find no choice to set a special DataMember. Is there another way to implement it for different class interfaces? The implemented Code as follows:
//populate root and Tree for Datasource One
ObjectQuery<EntityClass1> EntityClass1Query = workpieceContext.EntityClass1.Where("it.ParentEntityClass1 is NULL"); UltraTreeNode nodeWP = this.ultraTreeRequirements.Nodes.Add("Laborhilfsmittel");nodeWP.Nodes.SetDataBinding(EntityClass1Query.ToList(), "");
//populate root and Tree for Datasource Two
ObjectQuery<EntityClass2> EntityClass2Query = workpieceContext.EntityClass2;UltraTreeNode nodeComp = this.ultraTreeRequirements.Nodes.Add("Komponenten");nodeComp.Nodes.SetDataBinding(EntityClass2Query, "");
Thank you and Greatings: Rudy
Hi Rudy,
Yes, this is possible. What you do is add two nodes to the root level of the tree. Then, instead of binding the entire tree, you just bind the child nodes of those two nodes.
UltraTreeNode node = this.ultraTree1.Nodes.Add("My first Node");node.Nodes.SetDataBinding(dataSource, dataMember);