Click here to Skip to main content
15,886,030 members
Articles / Programming Languages / C#

Bind XML TreeView with GridView/DataGrid

Rate me:
Please Sign up or sign in to vote.
1.00/5 (11 votes)
22 Nov 2006CPOL 70.6K   1.2K   19  
This sample code is used to populate XML data into a GridView with a TreeView format.
<?xml version="1.0" ?>
<xs:schema id="employees" targetNamespace=http://tempuri.org/emp1.xsd
    xmlns:mstns="http://tempuri.org/emp1.xsd" 
    xmlns="http://tempuri.org/emp1.xsd" 
    xmlns:xs="http://www.w3.org/2001/XMLSchema" 
    xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" 
    attributeFormDefault="qualified" elementFormDefault="qualified">
<xs:element name="employees" msdata:IsDataSet="true" 
    msdata:EnforceConstraints="False">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
    <xs:element name="employee">
    <xs:complexType>
        <xs:sequence>
            <xs:element name="FirstName" type="xs:string" />
            <xs:element name="LastName" type="xs:string" />
            <xs:element name="DateOfBirth" type="xs:date" />
            <xs:element name="DateOfJoining" type="xs:date" />
            <xs:element name="Address" type="xs:string" />
            <xs:element name="Basic" type="xs:integer" />
            <xs:element name="Designation" type="xs:string" />
            <xs:element name="LeaveBalance" type="xs:int" />
        </xs:sequence>
    </xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
United States United States
Hi,
I have 5+ years of experience in Microsoft Technologies and have 2+ years of experience in .NET Technologies. Currenty I am woring in Visualsoft Technologies, Hyderabad and involed in Motorola projects. I feel in my carrier it's good projects. Because in this projects we are implementing the VS2005 and .NET 3.0 with Sqlserver 2005, also winfx.
SQL Server is my favourate subject, I was worked one ERP project as DBA. So it's was nice experience for me in SQL Server and
got BrainBench Certificate for .NET,DataBase and C#.


Comments and Discussions