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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:07:20+00:00 2026-06-12T07:07:20+00:00

I have create the following class for XML deserialization: [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute(code)] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType =

  • 0

I have create the following class for XML deserialization:

[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
public class ProgrammingConfiguration
{
    private uint versionField;
    private byte[] eLFImageField;
    private PreferenceType[] preferencesField;
    private ProgrammingConfigurationProtectFlashAfterProgramming   protectFlashAfterProgrammingField;

    //XML version
    public uint Version
    {
        get { return this.versionField; }
        set { this.versionField = value; }
    }

    //ELF image
    [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")]
    public byte[] ELFImage
    {
        get { return this.eLFImageField; }
        set { this.eLFImageField = value; }
    }

    //Preference
    [System.Xml.Serialization.XmlArrayItemAttribute("Preference", IsNullable = false)]
    public PreferenceType[] Preferences
    {
        get { return this.preferencesField; }
        set { this.preferencesField = value; }
    }

    //Protect flash after programming
    public ProgrammingConfigurationProtectFlashAfterProgramming ProtectFlashAfterProgramming
    {
        get { return this.protectFlashAfterProgrammingField; }
        set { this.protectFlashAfterProgrammingField = value; }
    }
}

//Preference Type
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class PreferenceType
{
    private string tagField;
    private PreferenceTypePrecedence precedenceField;
    private ValueType valueField;

    public string Tag
    {
        get { return this.tagField; }
        set { this.tagField = value; }
    }

    public PreferenceTypePrecedence Precedence
    {
        get { return this.precedenceField; }
        set { this.precedenceField = value; }
    }

    public ValueType Value
    {
        get { return this.valueField; }
        set { this.valueField = value; }
    }
}

//Precedence Type
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public enum PreferenceTypePrecedence
{
    XML,
    [System.Xml.Serialization.XmlEnumAttribute("Target,XML")]
    TargetXML,
    Target,
}

//Value Type
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class ValueType
{
    private string lengthField;
    private object itemField;
    private ItemChoiceType itemElementNameField;

    [System.Xml.Serialization.XmlElementAttribute(DataType = "integer")]
    public string Length
    {
        get { return this.lengthField; }
        set { this.lengthField = value; }
    }

    [System.Xml.Serialization.XmlElementAttribute("AutoIncrement", typeof(ValueTypeAutoIncrement))]
    [System.Xml.Serialization.XmlElementAttribute("HexBinary", typeof(string))]
    [System.Xml.Serialization.XmlElementAttribute("Integer", typeof(string))]
    [System.Xml.Serialization.XmlElementAttribute("String", typeof(string))]
    [System.Xml.Serialization.XmlChoiceIdentifierAttribute("ItemElementName")]
    public object Item
    {
        get { return this.itemField; }
        set { this.itemField = value; }
    }

    [System.Xml.Serialization.XmlIgnoreAttribute()]
    public ItemChoiceType ItemElementName
    {
        get { return this.itemElementNameField; }
        set { this.itemElementNameField = value; }
    }
}

//Autoincrement data
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class ValueTypeAutoIncrement
{
    private string minimumField;
    private string maximumField;
    private ValueTypeAutoIncrementOverflowBehaviour overflowBehaviourField;

    public string Minimum
    {
        get { return this.minimumField; }
        set { this.minimumField = value; }
    }

    public string Maximum
    {
        get { return this.maximumField; }
        set { this.maximumField = value; }
    }

    public ValueTypeAutoIncrementOverflowBehaviour OverflowBehaviour
    {
        get { return this.overflowBehaviourField; }
        set { this.overflowBehaviourField = value; }
    }
}

//Overflow behaviour
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public enum ValueTypeAutoIncrementOverflowBehaviour
{
    Wrap,
    Exception,
}

//Data type
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(IncludeInSchema = false)]
public enum ItemChoiceType
{
    AutoIncrement,
    HexBinary,
    Integer,
    String,
}

//ProtectFlashAfterProgramming
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public enum ProgrammingConfigurationProtectFlashAfterProgramming
{
    True,
    False,
}

I want to create 2 binding source, one for datagridview and one for textbox. I have tried the following:

        ProgrammingConfiguration pc = new ProgrammingConfiguration();

        XmlSerializer serializer = new XmlSerializer(typeof(ProgrammingConfiguration));

        //Reading the XML document requires a FileStream.            
        Stream reader = new FileStream(filename, FileMode.Open);

        //Call the Deserialize method to restore the object's state.
        pc = (ProgrammingConfiguration)serializer.Deserialize(reader);

        reader.Close();

        bindingsource.DataSource = pc;
        bindingsource.DataMember = "Preferences";


        bsV.DataSource = bindingsource;
        bsV.DataMember = "ItemElementName";

The program failed to run at the line bsV.DataMember = “ItemElementName”. Any suggestion please

  • 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-12T07:07:21+00:00Added an answer on June 12, 2026 at 7:07 am

    change:

    bindingsource.DataSource = pc;
    

    to:

    bindingsource.DataSource = new List { pc };
    

    i dont know why but PropertyManager doesnt like chaining properties, however CurrencyManager does. using an IEnumerable will fool and force the BindingContext create CurrencyManager instead of PropertyManager which is for binding single object. the issue isnt related to BindingSource you could set the DataSource property of the grid to the list and DataMember to the Preferences instead.

    you dont have to use BindingSource to bind to the textbox either.

    simply use:

    textBox.DataBindings.Add(list, "Preferences.ItemElementName");
    

    as for Value.Maximum use on of the:

    textBoxMaximum.DataBindings.Add(list, Preferences.Value.Maximum);
    textBoxMaximum.DataBindings.Add(bindingSource, Value.Maximum);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following class: /// <remarks/> [System.CodeDom.Compiler.GeneratedCodeAttribute(System.Xml, 4.0.30319.1)] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute(code)] [System.Xml.Serialization.XmlTypeAttribute(Namespace=urn:eu.emsa.ssn)] public
I have an the following class I'm trying to create a list of with
In Java I have created the following class which extends ImageView to create a
I have the following code that creates a serverside object of the xmlhttp class.
I have the following code: class Program { static void Main(string[] args) { using
I have to create an serializable class which has and xml in the format
I have the following class that I want to serialize to an XML file
I have to create object model for following XMLs: XML sample 1: <InvoiceAdd> <TxnDate>2009-01-21</TxnDate>
Hi I have the following legacy code. I would like to create a WCF
Hi i have use following code. public class InsertionExample extends Activity { private final

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.