i have object from class like this :
class student
{
private int st_ID;
private string name ;
private material[ mt;
}
class material
private int mt_ID;
private mark[ mk;
class mark
private int mk_ID;
now i recive object from student like this :
student [ ] std = new student[ ] { };
what i need to disblay in tree :
1- in first level the student name
2-in second level the material
3 in thired level the mark
remark : may be the student have mark may be not and may be have material and my be not
If you bind the tree to a List or BindingList of Student objects, then all you would have to do is add public properties that expose Lists or BindingList of the child objects (Marks and Materials).
thank you for replay ,but i am not undarstand can you explan the solution with example .
Hi,
There are several reasons why this might happen.
1) Your configuration object does not expose a Public property which returns a list.
2) Such a property does exist, but at the time you are binding to the tree (when the ColumnSets are generated), the property is returning null and the BindingManager in cannot determine the structure of the child data.
If you bind this same data source to the WinGrid, does it show the child rows there?
If you could post a small sample project demonstrating this behavior, I could tell you exactly why it's not working.
Is there a way to upload the project for you to see? It is a fairly simple project. The project purpose is to display a web.config file using an utra tree control. I have spent more time on the ultra tree control then on the entire implementation of the project.
Yes, I was going to ask you to upload a project, since I can't run or debug a code snippet. :)
When you reply to this post, go to the Options tab and you can attach a file to your post. So you will just need to zip up your sample project and solution.
I have attached the zip file.
Jean-Claude
Hi Jean-Claude,
Thanks for the sample.
I ran your sample, and I am getting the same results you describe. There's a tree with a single node and when I expand that node, there are no child nodes.
The first thing I did was put a WinGrid on the form and bind it to the same data source and I get the same results: a single row with no child rows.
So I look a look at the DataSource you are assigning to the Tree, which is the baseConfigList variable which is a List<BaseConfiguration>. Since you are binding to a list of the Base type, only the properties of the base type will be exposed by the BindingManager in DotNet.
The tree, the grid, or any other bound control has no control over this. This is the way DataBinding in DotNet works.
I thought you were binding to the derived types, which is why I was confused about why this was not working.
Thank a million. There was nothing proprietary in the code. I feel better when my code is not floating around.
I have removed the attached sample for you.
In the future, if you are concerned about posting proprietary information, we can arrange for you to send your sample directly through developer support. But generally speaking, it's better not to include anything proprietary in a sample. :)
Thanks. I now understand.
How can I remove my previous post with the attached project?