Click here to Skip to main content
Rate this: bad
good
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 0:18am
Edited 4-Nov-12 0:54am
48.2K
v2
Comments
Sergey Alexandrovich Kryukov at 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)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 359
1 Richard MacCutchan 310
2 OriginalGriff 290
3 Sharmanuj 146
4 Jared Sanow 145
0 Sergey Alexandrovich Kryukov 5,969
1 OriginalGriff 5,005
2 CPallini 2,473
3 Richard MacCutchan 1,547
4 Abhinav S 1,507


Advertise | Privacy | Mobile
Web01 | 2.8.140814.1 | Last Updated 4 Nov 2012
Copyright © CodeProject, 1999-2014
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