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

  • SEARCH
  • Home
  • 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 8215725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T11:52:56+00:00 2026-06-07T11:52:56+00:00

I have a database stored procedure call that, among other columns, returns a column

  • 0

I have a database stored procedure call that, among other columns, returns a column that contains data in XML format. I’m trying to display the results of this call in a grid (the call is made through Entity Framework, so the actual objects bound to the grid are POCO’s, and the column in question is a string property).

While the normal columns display correctly, I need to be able to take the XML data in that one column and bind its contents (it will contain multiple nodes) to an ItemsControl within the template for the cell.

For example, let’s say I have a grid that displays a collection of the following object:

class Photo
{
    string PhotoId { get; set; }
    string Name { get; set; }
    string TagListXml { get; set; }
}

This is intended to represent a photo, and the TagListXml property contains an XML string listing all of the tags that have been applied to the photo. Something akin to…

<PhotoTags>
    <Tag>Faces</Tag>
    <Tag>People</Tag>
    <Tag>Sepia</Tag>
</PhotoTags>

(While obviously a normal POCO would have a List<string> or something like that, let’s just assume for the moment that I must use an XML string)

In my grid, I want to be able to specify an ItemsControl that uses this XML and, ultimately, gives me items Faces, People, and Sepia.

I’ve tried this for a cell template:

<DataTemplate>
    <ItemsControl ItemsSource="{Binding TagListXml, 
                                Converter={StaticResource xmlConverter}}" />
</DataTemplate>

Where xmlConverter is defined as such:

<dc:StringToXmlConverter x:Key="xmlConverter" XPath="PhotoTags" />

And dc:StringToXmlConverter is a custom IValueConverter that just takes a string value, instantiates an XmlDocument and loads the string, then returns an XmlDataProvider with that new document and the XPath specified above.

While this does not produce any errors either in the form of an exception or a binding error in the Output window, it doesn’t do anything (there are no results displayed).

I believe this is because an XmlDataProvider cannot be set to the ItemsSource directly, but rather must be set as the Source of a Binding. (in other words, you must do ItemSource="{Binding Source={StaticResource xmlProvider}}" rather than ItemsSource="{StaticResource xmlProvider}").

I can’t seem to get anywhere with it, and I’ve been banging my head on this for the last couple of hours.

How can I bind an XML string to the ItemsSource of an ItemsControl?

  • 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-06-07T11:52:58+00:00Added an answer on June 7, 2026 at 11:52 am

    Why not return an XmlNode[] instead of a XmlDataProvider (which is mainly for XAML anyway)?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a stored procedure set up in DATABASE1 that among other things makes
I have a stored procedure in a SQL Server database that returns a list
I have a stored procedure that adds an object to the database and returns
I have a stored procedure called WEB_SEL_SECURITY_QUESTIONS in my sql database which returns a
I have a stored procedure call that goes like this: using (OracleConnection con =
I have a python program that calls a stored procedure from db2 database. I
I have a stored procedure, in one database within my SQL server, that sets
I have a very odd issue. When I execute a specific database stored procedure
We have business restriction in accessing the database only through stored procedure calls. Caching
So I have a stored procedure called Spr_EventLogCreate defined in my database. I have

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.