Click here to Skip to main content
15,886,788 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi,

I was stuck in binding the XML Data for Windows UI Controls using C#

The structure of my XML Sheet is as below

XML
<?xml version="1.0"?>
-<MySelectedValues> -
<Book>
    <BookID>1</BookID>
    <BookCaption>Technology</BookCaption>
    <BookTitle>C#</BookTitle>
    <Author>David Morrision</Author>
    <Description>Visual studio 2008</Description>
</Book>

<Book>
    <BookID>2</BookID>
    <BookCaption>Technology</BookCaption>
    <BookTitle>ASP.NET</BookTitle>
    <Author>Edward Steve</Author>
    <Description>Visual studio 2008 with ASP.NET 3.5</Description>
</Book>

<Book>
    <BookID>3</BookID>
    <BookCaption>Health</BookCaption>
    <BookTitle>Nutritions Food</BookTitle>
    <Author>Balley Moore</Author>
    <Description>Nutritions Food for Long Life</Description>
</Book>

<Book>
    <BookID>4</BookID>
    <BookCaption>Harware</BookCaption>
    <BookTitle>Server Book</BookTitle>
    <Author>Ronald Billy</Author>
    <Descriptiion> SQL SERVER 2008 Advacned R2</Description>
</Book>

<Book>
  <BookID>5</BookID>
    <BookCaption>Technology</BookCaption>
    <BookTitle>Server Book</BookTitle>
    <Author>Sunil Mitra</Author>
    <Description>Widnows Server 2008 </Description>
</MySelectedValues>




1. I have 3 Combo box and one Rich Text Box.
2. I want to filter the data in Combo box one after the another using the selected Index/Selected value or whatever suits best in the combo box

Eg: If i Select the "Book Caption" as Technology , I want to list all the Book Tile in the next combo Box as well if i select the "Book Title" i want to list all the Authors in Combo Box

3. Finally the description of the Book should to be displayed in the rich text box corresponding to selections

Thanks in Advance and appreciate your help

Regards
CodeKumar07
Posted
Updated 4-Nov-12 0:54am
v2
Comments
Sergey Alexandrovich Kryukov 4-Nov-12 11:57am    
It's a bad idea to bind XML files directly to UI. So, I don't see much sense in answering. You should better have some data model (in memory) which persists in XML or elsewhere. UI should "know" only the model, not XML. It could be as simple as Populate/Update.
--SA

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900