![]() |
How to filter XML Gridview w/ a DropDownList |
Post Reply
|
| Author | |
kernel
Just starting out
Joined: 28 Apr 2008 Online Status: Offline Posts: 3 |
Post Options
Quote Reply
Topic: How to filter XML Gridview w/ a DropDownListPosted: 28 Apr 2008 at 1:38pm |
|
Hi all. I love this site and this is my first post. I am populating a gridview with an XML file. But there is a lot of information in the GridView that I would like to filter out by using a DropDown List. The dropdown list can pull the filter field "category" from either XML or .mdb file. How can this be done? I have no problems doing this with both data sources being .mdb but am finding it more difficult with the data source being xml.
Thank you for the responses.
|
|
![]() |
|
| Sponsored Links | |
![]() |
|
jimd
Admin Group
Joined: 16 Oct 2006 Location: United Kingdom Online Status: Offline Posts: 4944 |
Post Options
Quote Reply
Posted: 28 Apr 2008 at 2:42pm |
|
Hi Kernal thank you for your kind words.
Can you give more details please?
One can filter the results of an xml file in the xml itself but i am unclear as to what you would like to do?
Thank you
JIM
|
|
![]() |
|
kernel
Just starting out
Joined: 28 Apr 2008 Online Status: Offline Posts: 3 |
Post Options
Quote Reply
Posted: 28 Apr 2008 at 2:48pm |
|
I don't want to force the user to be stuck with a certain filter. I would like for the user to filter the data as they wish. I'd like to be able to select a category from the dropdownlist and have the gridview automatically populate all of the data that pertains to that category selection. I can do this with an Access database without issue, I would like to able to do this with an XML file because I can have a user upload a new XML file without me having to touch it and the pages would build themselves dynamically.
Thanks for the reply.
|
|
![]() |
|
Jiggy
Moderator Group
Joined: 06 Feb 2007 Online Status: Offline Posts: 553 |
Post Options
Quote Reply
Posted: 30 Apr 2008 at 10:59am |
|
Can you submit some sample code? What you'll need to do is use an xpath query in your filter I'd imagine, but I could get more specific with the gridview and XML file posted.
|
|
|
http://www.medicalcontracting.com
|
|
![]() |
|
kernel
Just starting out
Joined: 28 Apr 2008 Online Status: Offline Posts: 3 |
Post Options
Quote Reply
Posted: 01 May 2008 at 6:38am |
|
This is a sample of the XML file I am using: <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<products xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <product> <item>6023-1306</item> <category>Wire Storage</category> <description>18 PAIR DOOR SHOE RACK</description> <image>6023-1306.jpg</image> </product> <product> <item>6024-575</item> <category>Wire Storage</category> <description>DELUXE ADJUSTABLE GARMENT RACK</description> <image>6024-575.jpg</image> </product> <product> <item>6062-1457</item> <category>Hangers</category> <description>S/4 CRYSTAL CUT DRESS/BLOUSE HANGERS</description> <image>6062-1457.jpg</image> </product> </products> I'm looking into the XPath now. I'm new to XML so the help is much appreciated.
|
|
![]() |
|
oisin_dubh
Learning Fast
Joined: 27 Jan 2007 Location: United Kingdom Online Status: Offline Posts: 59 |
Post Options
Quote Reply
Posted: 05 May 2008 at 2:54am |
|
This is probably truly inelegant - but may help.
For my small xml database I made xslts for the main data and also created seperate pages to call the main category- that is local region. (http://www.essauk.com). Users can click on a local link eg North West or Scotland or London to obtain all the information regarding members in that area. The Notes area can contian extra specified hyperlnks if you want pictures, their own web page etc. Imnot sure if this helps with your problem, I was thinkng you could have a menu that offers Wire cages with a subsequent sub menu for the various types, and another main choice for (I dont Know) Wire Widgets and deolve the sub menus for Big, deluxe etc. Hope this helps. Oh there is also a UK image map that links to the same info - you could even use the images to link to the xml descriptions? D |
|
![]() |
|
Post Reply
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |