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 6089855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:08:49+00:00 2026-05-23T12:08:49+00:00

My head is fuzzled with this. I have an xml doc which has the

  • 0

My head is fuzzled with this. I have an xml doc which has the layout for a grid stored in it. If you notice the columns are stored as “Items” in the XML. I am trying to retrieve each “Item” out of the XML using LINQ but no matter what I do I keep taking on straggler properties that I don’t need. Any help would be much appreciated.

  <?xml version="1.0" encoding="utf-16" ?> 
     <DatagridView>
        <ViewType>DevExpress.XtraGrid.Views.Grid.GridView</ViewType> 
           <ViewLayout> 
             <property name="Columns" iskey="true" value="9">
                <property name="Item1" isnull="true" iskey="true">
                   <property name="VisibleIndex">0</property> 
                   <property name="Visible">true</property> 
                   <property name="Width">1249</property> 
                   <property name="SummaryItem" isnull="true" iskey="true">
                      <property name="SummaryType">Count</property> 
                      <property name="DisplayFormat">{0}</property> 
                      <property name="FieldName">Comments</property> 
                      <property name="Tag" isnull="true" /> 
                   </property>
                   <property name="Name">colComments</property> 
                   <property name="ColumnEditName" /> 
                   <property name="FieldName">Comments</property> 
                </property>
                <property name="Item2" isnull="true" iskey="true">
                   <property name="VisibleIndex">1</property> 
                   <property name="Visible">true</property> 
                   <property name="Width">197</property> 
                   <property name="Name">colEvent</property> 
                   <property name="ColumnEditName" /> 
                   <property name="FieldName">Event</property> 
                </property>
                ......

EDIT:

To be clear, the XML can contain any number of columns represented like so:

            <property name="Item2" isnull="true" iskey="true">
               <property name="VisibleIndex">1</property> 
               <property name="Visible">true</property> 
               <property name="Width">197</property> 
               <property name="Name">colEvent</property> 
               <property name="ColumnEditName" /> 
               <property name="FieldName">Event</property> 
            </property>

I would like to grab those chunks of data in that same order via XML.

  • 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-23T12:08:50+00:00Added an answer on May 23, 2026 at 12:08 pm

    Well, you could just get the property elements directly beneath “Columns”:

    // TODO: Work out what to do if there are zero or multiple such elements
    var columns = xdoc.Descendants("property")
                      .Where(x => (string) x.Attribute("name") == "Columns")
                      .Single();
    
    var items = columns.Elements("property");
    
    foreach (var item in items)
    {
        Console.WriteLine("Item {0}", (string) item.Attribute("name"));
        foreach (var property in items.Elements("property"))
        {
            Console.WriteLine("  {0} = {1}", (string) item.Attribute("name"),
                              (string) item);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm scratching my head over this. I have a moderately successful app which has
This has been a head-banger for me. I have looked at all of the
Ive been smashing my head with this for a while. I have 2 completely
My head is getting bad trying to find a solution for this assignment because
I have 3 files Head.cpp , Head.h and Hello.cpp . I am trying to
In head, which comes first: meta or title? I was reading this: This [meta]
I am banging my head on the wall trying to understand this. See the
I'm banging my head against my desk trying to figure this out. I've got
Head hurts on this one so can someone throw me a line? XML is
Head scratching :( I am trying to bind one value to label and back

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.