Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How do I bind to an Xml Document

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Infralution Support Forum Index -> Virtual Tree FAQ
View previous topic :: View next topic  
Author Message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Fri Jan 27, 2006 5:03 am    Post subject: How do I bind to an Xml Document Reply with quote

You can bind to an XML document using Object Binding. To do this you create an Object binding for the System.Xml.XmlNode class (which XmlDocument derives from). However due to the fact that the System.Xml.XmlNode class is implemented as wrapper around COM objects you need to enter the fully qualified .NET type name - otherwise the .NET type system is unable to load the type. For VS2003 this is:

System.Xml.XmlNode, System.Xml, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

The XmlNodeList type returned by XmlNode.ChildNodes property does not support the IList interface (only IEnumerable). This means you also have to handle the GetChildren event and convert the child nodes to a standard array list as follows:

Code:
private void _virtualTree_GetChildren(object sender, Infralution.Controls.VirtualTree.GetChildrenEventArgs e)
{
    XmlNode node = e.Row.Item as XmlNode;
    ArrayList children = new ArrayList();
    foreach (XmlNode child in node.ChildNodes)
    {
        children.Add(child);
     }
     e.Children = children;
}

_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Infralution Support Forum Index -> Virtual Tree FAQ All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group