Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3938912
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:14:20+00:00 2026-05-20T00:14:20+00:00

I am working towards producing a small application that parses XML from a URL

  • 0

I am working towards producing a small application that parses XML from a URL and populates a Grid panel based on the contents of the XML. Currently, I have many other elements working properly, but still lack the knowledge needed to hide or show certain columns within the table and having it resize properly. Here’s the basic structure of my XAML thus far.

Currently, I feel as though my solution is very poor. I have hard coded each coulmn and row within the Grid and tied their Visibility to a code behind Converter. Under certain conditions, this Converter will return a Visibility of Hidden, but under other conditions it returns the value to display within the table. This feels very sloppy to me, so I assume I’ve designed this system incorrectly.

My question is more about the proper way to setup this type of system. I am much more familiar with generating the document structure itself within some business logic and then token swapping that generated structure with a token inside the raw document itself. What is a best way to accomplish the goal I’m pursuing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T00:14:20+00:00Added an answer on May 20, 2026 at 12:14 am

    You could provide the XDocument or XElement retrieved from the web service as the DataContext of an ItemsControl with a Grid. You would then use a DataTemplate to display the information.

    XML:

    <Entities>
        <Person Name="Ted" Age="42" />
        <Person Name="Sam" Age="19" />
        <Person Name="Bob" Age="25" />
        <Person Name="Angie" Age="38" />
    </Entities>
    

    Code Behind:

    this.DataContext = xdoc;
    

    XAML:

    <ItemsControl ItemsSource="{Binding Root.Elements[Person]}"
                  Grid.IsSharedSizeGroup="True">
        <ItemsControl.Resources>
            <DataTemplate DataType="Person">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition SharedSizeGroup="NameColumn"/>
                        <ColumnDefinition SharedSizeGroup="AgeColumn" />
                    </Grid.ColumnDefinitions>
                    <TextBox Text="{Binding Path=Attribute[Name].Value}" />
                    <TextBox Text="{Binding Path=Attribute[Age].Value}"
                             Grid.Column="1"/>
                </Grid>
            </DataTemplate>
        </ItemsControl.Resources>
    </ItemsControl>
    

    Linq to XML resources:

    • WPF Data Binding with LINQ to XML Overview
    • WPF Data Binding Using LINQ to XML Example
    • How to: Bind to XDocument, XElement, or LINQ for XML Query Results
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a geolocation project that is browser-based and geared specifically towards
I'm working towards sending an XML request to a URL using cURL in PHP.
I am a newbie working towards developing an IE extension that would appear as
I am working toward a small webapp that I would like to have a
I'm working on an iPhone project that needs to receive data from a PHP
I am developing an ASP.Net c# 4.0 application and am working towards a cross-tab
Background I have been working towards automating my Selenium test suite that I developed
My company is working towards moving our development from C++.net into C#. Our product
I am working towards an android application. I need to use a web service.
I have been working towards deploying my rails application, and while there have been

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.