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

The Archive Base Latest Questions

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

I’m using xsd files to validate xml files. In the xsd files, only a

  • 0

I’m using xsd files to validate xml files. In the xsd files, only a few of the elements are required and the rest are optional. However, it is sequential so the order of the elements as they appear in the datatable matter lots. After considering a few scenarios the user may encounter, I came up with a case that I have a little trouble solving.

The case is this:
For example,
There are 6 elements A, B, C, D, E, F in the xsd file. Only A, C, and D are needed.
The user starts off with A, C, D. I allow the user to add a column, with the name B.
However, it gets attached on the end: A, C, D, B. Therefore, since it’s sequential, it will not validate.

So my question is, how do I insert B between A and C in order for the xsd validation to pass? Or is there any other way to reorder the things in the datagridview and reflect that in the datatable?

I thought I would be able to solve the problem by allowing the user to reorder the columns in the datagridview where the table is displayed.

EDIT:
Under the assumption that I cannot alter the xsd files.

That is,

    dataGridView1.AllowUserToOrderColumns = true;

However, the validation always told me that an “element” after the last necessary element was expected. This means that the shift in the datacolumn in the datagridview was not reflected in the datatable itself.

In order to pass the validation, I believe I would need to insert the column in the respective place it is relative to everything else. Or at least insert it at the end and reflect the proper order when the user presses the validate button.

I’ve come across some other things online telling me to try things like:

    Table.Columns["Column Name"].SetOrdinal(NewIndex);

But I have not yet implemented it. Any ideas in case that line above doesn’t work? =)
Additionally, I want to be able to sync the datatable with what the user does in the datagridview. That would be ideal. If the user moves the columns in the datagridview, the datatable should reflect that change.

Any insight is greatly appreciated, I’ll be happy to offer additional information if needed. Thanks!

Sincerely,
tf.rz

(.NET 3.5 SP1, Visual Studio C# 2008)

  • 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-23T11:25:50+00:00Added an answer on May 23, 2026 at 11:25 am

    Wouldn’t it make more sense to not require the user to enter the data in schema order, and instead have the system automatically determine the appropriate order based on the schema? It seems that your schema(s) will be of similar construction given your assumptions, so determining the order from the schema should not be difficult.

    For ex., you could leave the DataTable as is, matching the user input, with columns in any arbitrary order. When you need to output the data to xml, examine the schema file and identify the sequence of elements that should be output. Iterate over the list of elements, and output matching columns from your DataTable as they’re found.

    To process the schema file and discover the sequence, you could either use System.Xml.Schema.XmlSchema, or, as the schema is itself xml, you could query the xml directly using XmlDocument, XPath, XDocument etc.

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

Sidebar

Related Questions

We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I have thousands of HTML files to process using Groovy/Java and I need to
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I want use html5's new tag to play a wav file (currently only supported
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I am reading a book about Javascript and jQuery and using one of the

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.