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
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.
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.
public class BaseConfiguration { private string name = null;
public BaseConfiguration() { }
public string Name { get { return name; } set { name = value; } } }
public class ConfigurationAttribute { private string name; private string _value;
public string Name { get { return name; } set { name = value; } }
public string Value { get { return _value; } set { _value = value; } } }
public class ConfigurationElement : BaseConfiguration { private List<ConfigurationAttribute> Attributes = null;
public ConfigurationElement() { Attributes = new List<ConfigurationAttribute>(); }
public void AddAttributes(ConfigurationAttribute attribute) { if (attribute != null) this.Attributes.Add(attribute); }
public List<ConfigurationAttribute> AttributeCollection { get { List<ConfigurationAttribute> deepCopyOfAttributes = new List<ConfigurationAttribute>();
foreach (ConfigurationAttribute item in Attributes) { deepCopyOfAttributes.Add(item); } return deepCopyOfAttributes; } } }
public class ConfigurationSection : BaseConfiguration { private List<BaseConfiguration> ItemCollection = null;
public ConfigurationSection() { ItemCollection = new List<BaseConfiguration>(); }
public void AddConfigElementOrSection(BaseConfiguration item) { if (item != null) ItemCollection.Add(item); }
public List<BaseConfiguration> GetConfigSectionCollection { get { List<BaseConfiguration> deepCopyOfItemCollection = new List<BaseConfiguration>();
foreach (BaseConfiguration item in ItemCollection) { deepCopyOfItemCollection.Add(item); } return deepCopyOfItemCollection; } } }
// the below code opened the xml file which is then parsed by the XmlParser class // a List collection of BaseConfiguration class is returned and bound to the ultra tree
xmlTextReader = new XmlTextReader(openedFile);
ReaderType<XmlTextReader> rType = new ReaderType<XmlTextReader>(xmlTextReader);
XmlParser xmlParser = new XmlParser();
ConfigurationSection config = new ConfigurationSection();
config = xmlParser.Parse(rType);
List<BaseConfiguration> baseConfigList = new List<BaseConfiguration>();
baseConfigList = config.GetConfigSectionCollection;
UltraTree.DataSource = baseConfigList;
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.
My properties are public and they are not members.
No, I am not creating any ColumnSets.
I have changed the ultra tree view style to Grid.
Yes, I am leaving the tree to it's default settings.
The below picture shows the root node is not displaying the child nodes.
My earlier message post with two images used a different List object than the one I am trying to solve right now. I am sorry about that confusion.