Click here to Skip to main content
12,765,284 members (37,126 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: XML
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 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 4-Nov-12 1:18am
Updated 4-Nov-12 1:54am
Nelek115.9K
v2
Comments
   
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)

    Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.170217.1 | Last Updated 4 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100