none
RowState wechselt zu modified ohne Änderung der Daten. RRS feed

  • Frage

  • Ich habe ein Problem mit den RowState.

    Aufbau:
    Ich nutze ein DataSet mit DataTable und TableAdapter. Die Daten werden aus einer MSSQL Datenbank geladen.
    Für die Anzeige der Daten wurde ein UserControl entwickelt.
    Es werden in diesen UserControl die Daten gebunden an eine BindingSource und dann an Textbox und Combobox Controls.

    Nach dem Füllen der DataTable ist der RowState auf unchanged, nach Wechsel auf den nächsten Datensatz ändert sich die RowState zu modified ohne das eine Änderung der Daten vorgenommen wurde.

    Ich kann nicht erkennen warum sich der RowState ändern.

    Hoffe Ihr habt ein paar Ideen dazu.

    Hier mal mein Code.

    Bitte vergebt mir wenn das etwas unübersichtlich oder vielleicht schlecht Programmiert ist.

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    
    namespace Bonderbelegung.GUI.Programs
    {
        public partial class Produkt : UserControl
        {
            private NLog.Logger log = NLog.LogManager.GetCurrentClassLogger();
            private int iCounter = 0;
    
            private int _currentID;
            public int CurrentID
            {
                get
                {
                    return _currentID;
                }
                set
                {
                    _currentID = value;
                    FillByCurrentID();
                }
            }
    
            public Produkt()
            {
                log.Info("Formular wird initialisiert.");
                InitializeComponent();
                log.Debug("Formular fertig initialisiert.");
                vPFUFamilieTextBox.Enabled = false;
                dSData.Product.ProductRowChanging += Product_ProductRowChanging;
                dSData.Product.ProductRowChanged += Product_ProductRowChanged;
            }
    
            private void Product_ProductRowChanged(object sender, DSData.ProductRowChangeEvent e)
            {
                log.Debug("RowState Changed - Status => " + e.Row.RowState.ToString() + " | " + e.Row.A2CProduct);
            }
    
            private void Product_ProductRowChanging(object sender, DSData.ProductRowChangeEvent e)
            {
                log.Debug("RowState Changing - Status => " +  e.Row.RowState.ToString() + " | " + e.Row.A2CProduct);
            }
    
            private void ProductBindingNavigatorSaveItem_Click(object sender, EventArgs e)
            {
                this.Validate();
                this.productBindingSource.EndEdit();
                //Generic.LogModification(dSData, dSData.Product.TableName);
                try
                {
                    iCounter = this.tableAdapterManager.UpdateAll(this.dSData);
                }
                catch (Exception ex)
                {
                    log.Error(ex, "Fehler beim Speichern der Daten. " + ex.Message);
                    MessageBox.Show(this, "Fehler beim Speichern der Daten.\n" + ex.Message, "Fehler beim Speichern", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                log.Info($"Daten werden gespeichert. {iCounter} Reihen sind betroffen.");
            }
    
            private void Produkt_Load(object sender, EventArgs e)
            {
                // Alle Daten in Datatabelle Laden.
                this.vwMEMSAdhesiveTableAdapter.Fill(this.dSData.vwMEMSAdhesive);
                this.vwASICAdhesiveTableAdapter.Fill(this.dSData.vwASICAdhesive);
                this.housingTableAdapter.Fill(this.dSData.Housing);
                this.presureSensorTypeTableAdapter.Fill(this.dSData.PresureSensorType);
                this.bondBelegungTableAdapter.Fill(this.dSData.BondBelegung);
                this.customerTableAdapter.Fill(this.dSData.Customer);
    
                //this.productTableAdapter.Fill(this.dSData.Product);
    
                // ASIC und MEMS Boxen füllen
                SetASICcbx();
                SetMEMScbx();
    
                FillByCurrentID();
            }
            private void SetASICcbx()
            {
                DataTable Items = new DataTable();
                Items.Columns.Add("ID");
                Items.Columns.Add("Text");
                foreach (DSData.vwASICAdhesiveRow item in dSData.vwASICAdhesive)
                {
                    Items.Rows.Add(new Object[] { item.IDASICAdhesive, item.ASIC + " / " + item.Adhesive });
                }
                iDASICAdhesiveComboBox.DataSource = Items;
                iDASICAdhesiveComboBox.DisplayMember = "Text";
                iDASICAdhesiveComboBox.ValueMember = "ID";
    
                iDASICAdhesiveComboBox.SelectedIndexChanged += new EventHandler(IDASICAdhesiveComboBox_SelectedIndexChanged);
            }
            private void SetMEMScbx()
            {
                DataTable Items = new DataTable();
                Items.Columns.Add("ID");
                Items.Columns.Add("Text");
                foreach (DSData.vwMEMSAdhesiveRow item in dSData.vwMEMSAdhesive)
                {
                    Items.Rows.Add(new Object[] { item.IDMEMSAdhesive, item.MEMS + " / " + item.Adhesive });
                }
                iDMEMSAdhesiveComboBox.DataSource = new BindingSource(Items,null);
                iDMEMSAdhesiveComboBox.DisplayMember = "Text";
                iDMEMSAdhesiveComboBox.ValueMember = "ID";
    
                iDMEMSAdhesiveComboBox.SelectedIndexChanged += new EventHandler(IDMEMSAdhesiveComboBox_SelectedIndexChanged);
            }
            
            private void FillByCurrentID()
            {
                // Datentabellen mit akutellen Daten füllen.
                iCounter = productTableAdapter.FillByIDBondProgram(this.dSData.Product, CurrentID);
                //productBindingSource.Filter = $"IDBondProgram = {CurrentID}";
                dSData.Product.IDBondProgramColumn.DefaultValue = CurrentID;
                log.Debug($"Fülle Table Adapter. IDBondProgram: {CurrentID}, Anzahl Reihen: {iCounter}.");
            }
            
            private void BtnAddPicture_Click(object sender, EventArgs e)
            {
                OpenFileDialog f = new OpenFileDialog
                {
                    Filter = "Image Files(*.BMP;*.JPG;*.GIF;*.PNG)|*.BMP;*.JPG;*.GIF;*.PNG|All files (*.*)|*.*"
                };
                if (f.ShowDialog() == DialogResult.OK)
                {
                    log.Debug($"Bild wird geladen. Datei: {f.FileName}.");
                    try
                    {
                        Image image = Image.FromFile(f.FileName);
                        pbxProduct.Image = image;
                    }
                    catch (OutOfMemoryException)
                    {
                        MessageBox.Show("Die Datei besitzt kein gültiges Bildformat oder wird nicht unterstützt.");
                    }
                    
                }
            }
    
            private void BtnRemovePicture_Click(object sender, EventArgs e)
            {
                pbxProduct.Image = null;
            }
    
            private void VPFUFamilieVorhandenCheckBox_CheckedChanged(object sender, EventArgs e)
            {
                vPFUFamilieTextBox.Enabled = vPFUFamilieVorhandenCheckBox.Checked;
                if (!vPFUFamilieVorhandenCheckBox.Checked)
                    vPFUFamilieTextBox.Text = string.Empty;
            }
    
            private void IDBelegungComboBox_SelectedValueChanged(object sender, EventArgs e)
            {
                // Bild nur anzeigen wenn auch Daten vorhanden sind.
                pbxBelegung.Visible = iDBelegungComboBox.SelectedValue != null;
            }
    
            private void IDASICAdhesiveComboBox_SelectedIndexChanged(object sender, EventArgs e)
            {
                var value = iDASICAdhesiveComboBox.SelectedValue;
                if (value != null)
                {
                    log.Debug("Value: " + value);
                    vwASICAdhesiveBindingSource.Filter = $"IDASICAdhesive = {value}";
                }
                else
                {
                    vwASICAdhesiveBindingSource.Filter = $"IDASICAdhesive = -1";
                }
            }
            private void IDMEMSAdhesiveComboBox_SelectedIndexChanged(object sender, EventArgs e)
            {
                var value = iDMEMSAdhesiveComboBox.SelectedValue;
                if (value != null)
                {
                    log.Debug("Value: " + value);
                    vwMEMSAdhesiveBindingSource.Filter = $"IDMEMSAdhesive = {value}";
                }
                else
                {
                    vwMEMSAdhesiveBindingSource.Filter = $"IDMEMSAdhesive = -1";
                }
            }
           
    
            #region AddElements
            private void AddCustomer_Click(object sender, EventArgs e)
            {
                Customer customer = new Customer();
                customer.ShowDialog(this);
                iCounter = customerTableAdapter.Fill(dSData.Customer);
                customer = null;
            }
    
            private void AddBelegung_Click(object sender, EventArgs e)
            {
                Bondbelegung bondbelegung = new Bondbelegung();
                bondbelegung.ShowDialog(this);
                bondBelegungTableAdapter.Fill(dSData.BondBelegung);
                bondbelegung = null;
            }
    
            private void AddPresureSensor_Click(object sender, EventArgs e)
            {
                PresureSensor presureSensor = new PresureSensor();
                presureSensor.ShowDialog(this);
                presureSensorTypeTableAdapter.Fill(dSData.PresureSensorType);
                presureSensor = null;
            }
    
            private void AddHousing_Click(object sender, EventArgs e)
            {
                Housing housing = new Housing();
                housing.ShowDialog(this);
                housingTableAdapter.Fill(dSData.Housing);
                housing = null;
            }
    
            private void AddASICAdhesive_Click(object sender, EventArgs e)
            {
                ASICAdhesive aSICAdhesive = new ASICAdhesive();
                aSICAdhesive.ShowDialog(this);
                vwASICAdhesiveTableAdapter.Fill(dSData.vwASICAdhesive);
                aSICAdhesive = null;
            }
    
            private void AddMEMSAdhesive_Click(object sender, EventArgs e)
            {
                MEMSAdhesive mEMSAdhesive = new MEMSAdhesive();
                mEMSAdhesive.ShowDialog(this);
                vwMEMSAdhesiveTableAdapter.Fill(dSData.vwMEMSAdhesive);
                mEMSAdhesive = null;
            }
    
    
            #endregion
        }
    }
    

    Donnerstag, 11. Juli 2019 10:11

Antworten

  • Hallo Peter,

    ich habe etwas verwirrend geschrieben.

    An sich habe ich die Fehlerquelle gefunden. Durch die Datenbindung PictureBox<->DataTable von Datentyp IMAGE wird bei Wechsel der Datenreihe die Reihe auf modified gesetzt.

    Hier mal ein Testcode der dieses verhalten darstellt.

    using System;
    using System.Windows.Forms;
    namespace Bonderbelegung.GUI.Programs
    {
    	partial class Test
        {
            /// <summary>
            /// Required designer variable.
            /// </summary>
            private System.ComponentModel.IContainer components = null;
    
            /// <summary>
            /// Clean up any resources being used.
            /// </summary>
            /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
            protected override void Dispose(bool disposing)
            {
                if (disposing && (components != null))
                {
                    components.Dispose();
                }
                base.Dispose(disposing);
            }
    
            #region Windows Form Designer generated code
    
            /// <summary>
            /// Required method for Designer support - do not modify
            /// the contents of this method with the code editor.
            /// </summary>
            private void InitializeComponent()
            {
                this.components = new System.ComponentModel.Container();
                System.Windows.Forms.Label a2CProductLabel;
                System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Test));
                this.dSData = new Bonderbelegung.DSData();
                this.productBindingSource = new System.Windows.Forms.BindingSource(this.components);
                this.productTableAdapter = new Bonderbelegung.DSDataTableAdapters.ProductTableAdapter();
                this.tableAdapterManager = new Bonderbelegung.DSDataTableAdapters.TableAdapterManager();
                this.productBindingNavigator = new System.Windows.Forms.BindingNavigator(this.components);
                this.bindingNavigatorSeparator = new System.Windows.Forms.ToolStripSeparator();
                this.bindingNavigatorPositionItem = new System.Windows.Forms.ToolStripTextBox();
                this.bindingNavigatorCountItem = new System.Windows.Forms.ToolStripLabel();
                this.bindingNavigatorSeparator1 = new System.Windows.Forms.ToolStripSeparator();
                this.bindingNavigatorSeparator2 = new System.Windows.Forms.ToolStripSeparator();
                this.a2CProductTextBox = new System.Windows.Forms.TextBox();
                this.bindingNavigatorAddNewItem = new System.Windows.Forms.ToolStripButton();
                this.bindingNavigatorDeleteItem = new System.Windows.Forms.ToolStripButton();
                this.bindingNavigatorMoveFirstItem = new System.Windows.Forms.ToolStripButton();
                this.bindingNavigatorMovePreviousItem = new System.Windows.Forms.ToolStripButton();
                this.bindingNavigatorMoveNextItem = new System.Windows.Forms.ToolStripButton();
                this.bindingNavigatorMoveLastItem = new System.Windows.Forms.ToolStripButton();
                this.productBindingNavigatorSaveItem = new System.Windows.Forms.ToolStripButton();
                this.pictureBox1 = new System.Windows.Forms.PictureBox();
                a2CProductLabel = new System.Windows.Forms.Label();
                ((System.ComponentModel.ISupportInitialize)(this.dSData)).BeginInit();
                ((System.ComponentModel.ISupportInitialize)(this.productBindingSource)).BeginInit();
                ((System.ComponentModel.ISupportInitialize)(this.productBindingNavigator)).BeginInit();
                this.productBindingNavigator.SuspendLayout();
                ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
                this.SuspendLayout();
                // 
                // dSData
                // 
                this.dSData.DataSetName = "DSData";
                this.dSData.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
                // 
                // productBindingSource
                // 
                this.productBindingSource.DataMember = "Product";
                this.productBindingSource.DataSource = this.dSData;
                // 
                // productTableAdapter
                // 
                this.productTableAdapter.ClearBeforeFill = true;
                // 
                // tableAdapterManager
                // 
                this.tableAdapterManager.AdhesiveTableAdapter = null;
                this.tableAdapterManager.AreaTableAdapter = null;
                this.tableAdapterManager.ASICAdhesiveTableAdapter = null;
                this.tableAdapterManager.ASICTableAdapter = null;
                this.tableAdapterManager.BackupDataSetBeforeUpdate = false;
                this.tableAdapterManager.BondableSurfaceTableAdapter = null;
                this.tableAdapterManager.BondBelegungTableAdapter = null;
                this.tableAdapterManager.BonderProductTableAdapter = null;
                this.tableAdapterManager.BonderzuordnungLeftTableAdapter = null;
                this.tableAdapterManager.BondWireTableAdapter = null;
                this.tableAdapterManager.CustomerTableAdapter = null;
                this.tableAdapterManager.HousingTableAdapter = null;
                this.tableAdapterManager.LogTableAdapter = null;
                this.tableAdapterManager.LoopControlTableAdapter = null;
                this.tableAdapterManager.LoopParamsTableAdapter = null;
                this.tableAdapterManager.LoopTypeTableAdapter = null;
                this.tableAdapterManager.MEMSAdhesiveTableAdapter = null;
                this.tableAdapterManager.MEMSTableAdapter = null;
                this.tableAdapterManager.PresureSensorTypeTableAdapter = null;
                this.tableAdapterManager.ProductTableAdapter = this.productTableAdapter;
                this.tableAdapterManager.SupplierTableAdapter = null;
                this.tableAdapterManager.UpdateOrder = Bonderbelegung.DSDataTableAdapters.TableAdapterManager.UpdateOrderOption.InsertUpdateDelete;
                this.tableAdapterManager.vwBonderProductTableAdapter = null;
                this.tableAdapterManager.vwBonderProgramTableAdapter = null;
                this.tableAdapterManager.vwProgrammlistTableAdapter = null;
                this.tableAdapterManager.WedgeParamTableAdapter = null;
                this.tableAdapterManager.WireCutParamsTableAdapter = null;
                // 
                // productBindingNavigator
                // 
                this.productBindingNavigator.AddNewItem = this.bindingNavigatorAddNewItem;
                this.productBindingNavigator.BindingSource = this.productBindingSource;
                this.productBindingNavigator.CountItem = this.bindingNavigatorCountItem;
                this.productBindingNavigator.DeleteItem = this.bindingNavigatorDeleteItem;
                this.productBindingNavigator.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
                this.bindingNavigatorMoveFirstItem,
                this.bindingNavigatorMovePreviousItem,
                this.bindingNavigatorSeparator,
                this.bindingNavigatorPositionItem,
                this.bindingNavigatorCountItem,
                this.bindingNavigatorSeparator1,
                this.bindingNavigatorMoveNextItem,
                this.bindingNavigatorMoveLastItem,
                this.bindingNavigatorSeparator2,
                this.bindingNavigatorAddNewItem,
                this.bindingNavigatorDeleteItem,
                this.productBindingNavigatorSaveItem});
                this.productBindingNavigator.Location = new System.Drawing.Point(0, 0);
                this.productBindingNavigator.MoveFirstItem = this.bindingNavigatorMoveFirstItem;
                this.productBindingNavigator.MoveLastItem = this.bindingNavigatorMoveLastItem;
                this.productBindingNavigator.MoveNextItem = this.bindingNavigatorMoveNextItem;
                this.productBindingNavigator.MovePreviousItem = this.bindingNavigatorMovePreviousItem;
                this.productBindingNavigator.Name = "productBindingNavigator";
                this.productBindingNavigator.PositionItem = this.bindingNavigatorPositionItem;
                this.productBindingNavigator.Size = new System.Drawing.Size(800, 25);
                this.productBindingNavigator.TabIndex = 0;
                this.productBindingNavigator.Text = "bindingNavigator1";
                // 
                // bindingNavigatorSeparator
                // 
                this.bindingNavigatorSeparator.Name = "bindingNavigatorSeparator";
                this.bindingNavigatorSeparator.Size = new System.Drawing.Size(6, 25);
                // 
                // bindingNavigatorPositionItem
                // 
                this.bindingNavigatorPositionItem.AccessibleName = "Position";
                this.bindingNavigatorPositionItem.AutoSize = false;
                this.bindingNavigatorPositionItem.Name = "bindingNavigatorPositionItem";
                this.bindingNavigatorPositionItem.Size = new System.Drawing.Size(50, 23);
                this.bindingNavigatorPositionItem.Text = "0";
                this.bindingNavigatorPositionItem.ToolTipText = "Aktuelle Position";
                // 
                // bindingNavigatorCountItem
                // 
                this.bindingNavigatorCountItem.Name = "bindingNavigatorCountItem";
                this.bindingNavigatorCountItem.Size = new System.Drawing.Size(44, 22);
                this.bindingNavigatorCountItem.Text = "von {0}";
                this.bindingNavigatorCountItem.ToolTipText = "Die Gesamtanzahl der Elemente.";
                // 
                // bindingNavigatorSeparator1
                // 
                this.bindingNavigatorSeparator1.Name = "bindingNavigatorSeparator";
                this.bindingNavigatorSeparator1.Size = new System.Drawing.Size(6, 25);
                // 
                // bindingNavigatorSeparator2
                // 
                this.bindingNavigatorSeparator2.Name = "bindingNavigatorSeparator";
                this.bindingNavigatorSeparator2.Size = new System.Drawing.Size(6, 25);
                // 
                // a2CProductLabel
                // 
                a2CProductLabel.AutoSize = true;
                a2CProductLabel.Location = new System.Drawing.Point(46, 45);
                a2CProductLabel.Name = "a2CProductLabel";
                a2CProductLabel.Size = new System.Drawing.Size(67, 13);
                a2CProductLabel.TabIndex = 1;
                a2CProductLabel.Text = "A2CProduct:";
                // 
                // a2CProductTextBox
                // 
                this.a2CProductTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.productBindingSource, "A2CProduct", true));
                this.a2CProductTextBox.Location = new System.Drawing.Point(119, 42);
                this.a2CProductTextBox.Name = "a2CProductTextBox";
                this.a2CProductTextBox.Size = new System.Drawing.Size(100, 20);
                this.a2CProductTextBox.TabIndex = 2;
                // 
                // bindingNavigatorAddNewItem
                // 
                this.bindingNavigatorAddNewItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
                this.bindingNavigatorAddNewItem.Image = ((System.Drawing.Image)(resources.GetObject("bindingNavigatorAddNewItem.Image")));
                this.bindingNavigatorAddNewItem.Name = "bindingNavigatorAddNewItem";
                this.bindingNavigatorAddNewItem.RightToLeftAutoMirrorImage = true;
                this.bindingNavigatorAddNewItem.Size = new System.Drawing.Size(23, 22);
                this.bindingNavigatorAddNewItem.Text = "Neu hinzufügen";
                // 
                // bindingNavigatorDeleteItem
                // 
                this.bindingNavigatorDeleteItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
                this.bindingNavigatorDeleteItem.Image = ((System.Drawing.Image)(resources.GetObject("bindingNavigatorDeleteItem.Image")));
                this.bindingNavigatorDeleteItem.Name = "bindingNavigatorDeleteItem";
                this.bindingNavigatorDeleteItem.RightToLeftAutoMirrorImage = true;
                this.bindingNavigatorDeleteItem.Size = new System.Drawing.Size(23, 22);
                this.bindingNavigatorDeleteItem.Text = "Löschen";
                // 
                // bindingNavigatorMoveFirstItem
                // 
                this.bindingNavigatorMoveFirstItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
                this.bindingNavigatorMoveFirstItem.Image = ((System.Drawing.Image)(resources.GetObject("bindingNavigatorMoveFirstItem.Image")));
                this.bindingNavigatorMoveFirstItem.Name = "bindingNavigatorMoveFirstItem";
                this.bindingNavigatorMoveFirstItem.RightToLeftAutoMirrorImage = true;
                this.bindingNavigatorMoveFirstItem.Size = new System.Drawing.Size(23, 22);
                this.bindingNavigatorMoveFirstItem.Text = "Erste verschieben";
                // 
                // bindingNavigatorMovePreviousItem
                // 
                this.bindingNavigatorMovePreviousItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
                this.bindingNavigatorMovePreviousItem.Image = ((System.Drawing.Image)(resources.GetObject("bindingNavigatorMovePreviousItem.Image")));
                this.bindingNavigatorMovePreviousItem.Name = "bindingNavigatorMovePreviousItem";
                this.bindingNavigatorMovePreviousItem.RightToLeftAutoMirrorImage = true;
                this.bindingNavigatorMovePreviousItem.Size = new System.Drawing.Size(23, 22);
                this.bindingNavigatorMovePreviousItem.Text = "Vorherige verschieben";
                // 
                // bindingNavigatorMoveNextItem
                // 
                this.bindingNavigatorMoveNextItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
                this.bindingNavigatorMoveNextItem.Image = ((System.Drawing.Image)(resources.GetObject("bindingNavigatorMoveNextItem.Image")));
                this.bindingNavigatorMoveNextItem.Name = "bindingNavigatorMoveNextItem";
                this.bindingNavigatorMoveNextItem.RightToLeftAutoMirrorImage = true;
                this.bindingNavigatorMoveNextItem.Size = new System.Drawing.Size(23, 22);
                this.bindingNavigatorMoveNextItem.Text = "Nächste verschieben";
                // 
                // bindingNavigatorMoveLastItem
                // 
                this.bindingNavigatorMoveLastItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
                this.bindingNavigatorMoveLastItem.Image = ((System.Drawing.Image)(resources.GetObject("bindingNavigatorMoveLastItem.Image")));
                this.bindingNavigatorMoveLastItem.Name = "bindingNavigatorMoveLastItem";
                this.bindingNavigatorMoveLastItem.RightToLeftAutoMirrorImage = true;
                this.bindingNavigatorMoveLastItem.Size = new System.Drawing.Size(23, 22);
                this.bindingNavigatorMoveLastItem.Text = "Letzte verschieben";
                // 
                // productBindingNavigatorSaveItem
                // 
                this.productBindingNavigatorSaveItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
                this.productBindingNavigatorSaveItem.Image = ((System.Drawing.Image)(resources.GetObject("productBindingNavigatorSaveItem.Image")));
                this.productBindingNavigatorSaveItem.Name = "productBindingNavigatorSaveItem";
                this.productBindingNavigatorSaveItem.Size = new System.Drawing.Size(23, 22);
                this.productBindingNavigatorSaveItem.Text = "Daten speichern";
                this.productBindingNavigatorSaveItem.Click += new System.EventHandler(this.productBindingNavigatorSaveItem_Click);
                // 
                // pictureBox1
                // 
                this.pictureBox1.DataBindings.Add(new System.Windows.Forms.Binding("Image", this.productBindingSource, "Picture", true));
                this.pictureBox1.Location = new System.Drawing.Point(37, 80);
                this.pictureBox1.Name = "pictureBox1";
                this.pictureBox1.Size = new System.Drawing.Size(358, 244);
                this.pictureBox1.TabIndex = 3;
                this.pictureBox1.TabStop = false;
                // 
                // Test
                // 
                this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
                this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
                this.ClientSize = new System.Drawing.Size(800, 450);
                this.Controls.Add(this.pictureBox1);
                this.Controls.Add(a2CProductLabel);
                this.Controls.Add(this.a2CProductTextBox);
                this.Controls.Add(this.productBindingNavigator);
                this.Name = "Test";
                this.Text = "Test";
                this.Load += new System.EventHandler(this.Test_Load);
                ((System.ComponentModel.ISupportInitialize)(this.dSData)).EndInit();
                ((System.ComponentModel.ISupportInitialize)(this.productBindingSource)).EndInit();
                ((System.ComponentModel.ISupportInitialize)(this.productBindingNavigator)).EndInit();
                this.productBindingNavigator.ResumeLayout(false);
                this.productBindingNavigator.PerformLayout();
                ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
                this.ResumeLayout(false);
                this.PerformLayout();
    
            }
    
            #endregion
    
            private DSData dSData;
            private System.Windows.Forms.BindingSource productBindingSource;
            private DSDataTableAdapters.ProductTableAdapter productTableAdapter;
            private DSDataTableAdapters.TableAdapterManager tableAdapterManager;
            private System.Windows.Forms.BindingNavigator productBindingNavigator;
            private System.Windows.Forms.ToolStripButton bindingNavigatorAddNewItem;
            private System.Windows.Forms.ToolStripLabel bindingNavigatorCountItem;
            private System.Windows.Forms.ToolStripButton bindingNavigatorDeleteItem;
            private System.Windows.Forms.ToolStripButton bindingNavigatorMoveFirstItem;
            private System.Windows.Forms.ToolStripButton bindingNavigatorMovePreviousItem;
            private System.Windows.Forms.ToolStripSeparator bindingNavigatorSeparator;
            private System.Windows.Forms.ToolStripTextBox bindingNavigatorPositionItem;
            private System.Windows.Forms.ToolStripSeparator bindingNavigatorSeparator1;
            private System.Windows.Forms.ToolStripButton bindingNavigatorMoveNextItem;
            private System.Windows.Forms.ToolStripButton bindingNavigatorMoveLastItem;
            private System.Windows.Forms.ToolStripSeparator bindingNavigatorSeparator2;
            private System.Windows.Forms.ToolStripButton productBindingNavigatorSaveItem;
            private System.Windows.Forms.TextBox a2CProductTextBox;
            private System.Windows.Forms.PictureBox pictureBox1;
        }
    	
    	public partial class Test : Form
        {
            public Test()
            {
                InitializeComponent();
                dSData.Product.ProductRowChanging += Product_ProductRowChanging;
                dSData.Product.ProductRowChanged += Product_ProductRowChanged;
            }
    
            private void Product_ProductRowChanged(object sender, DSData.ProductRowChangeEvent e)
            {
                Console.WriteLine($"Produkt Row Changed RowState: {e.Row.RowState.ToString()}");
            }
    
            private void Product_ProductRowChanging(object sender, DSData.ProductRowChangeEvent e)
            {
                Console.WriteLine($"Produkt Row Changing RowState: {e.Row.RowState.ToString()}");
            }
    
            private void productBindingNavigatorSaveItem_Click(object sender, EventArgs e)
            {
                this.Validate();
                this.productBindingSource.EndEdit();
                this.tableAdapterManager.UpdateAll(this.dSData);
    
            }
    
            private void Test_Load(object sender, EventArgs e)
            {
                // TODO: Diese Codezeile lädt Daten in die Tabelle "dSData.Product". Sie können sie bei Bedarf verschieben oder entfernen.
                this.productTableAdapter.Fill(this.dSData.Product);
    
            }
        }
    }

    Freitag, 12. Juli 2019 12:37

Alle Antworten

  • Ursache ist hier die Datenbindung an das Produktbild.

    this.pbxProduct.DataBindings.Add(new System.Windows.Forms.Binding("Image", this.productBindingSource, "Picture", true));
                
    Wenn ich diese Bindung lösche wird der RowState nicht geändert.

    Donnerstag, 11. Juli 2019 12:54
  • Hi Georg,
    im gezeigten Code fehlt der Befehl, den Du im folgenden Beitrag gezeigt hast. Welche Frage hast Du zu den unterschiedlichen Codestücken (aus unterschiedlichen Code-Dateien)?

    --
    Best Regards / Viele Grüße
    Peter Fleischer (former MVP for Developer Technologies)
    Homepage, Tipps, Tricks

    Freitag, 12. Juli 2019 06:00
  • Hallo Peter,

    ich habe etwas verwirrend geschrieben.

    An sich habe ich die Fehlerquelle gefunden. Durch die Datenbindung PictureBox<->DataTable von Datentyp IMAGE wird bei Wechsel der Datenreihe die Reihe auf modified gesetzt.

    Hier mal ein Testcode der dieses verhalten darstellt.

    using System;
    using System.Windows.Forms;
    namespace Bonderbelegung.GUI.Programs
    {
    	partial class Test
        {
            /// <summary>
            /// Required designer variable.
            /// </summary>
            private System.ComponentModel.IContainer components = null;
    
            /// <summary>
            /// Clean up any resources being used.
            /// </summary>
            /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
            protected override void Dispose(bool disposing)
            {
                if (disposing && (components != null))
                {
                    components.Dispose();
                }
                base.Dispose(disposing);
            }
    
            #region Windows Form Designer generated code
    
            /// <summary>
            /// Required method for Designer support - do not modify
            /// the contents of this method with the code editor.
            /// </summary>
            private void InitializeComponent()
            {
                this.components = new System.ComponentModel.Container();
                System.Windows.Forms.Label a2CProductLabel;
                System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Test));
                this.dSData = new Bonderbelegung.DSData();
                this.productBindingSource = new System.Windows.Forms.BindingSource(this.components);
                this.productTableAdapter = new Bonderbelegung.DSDataTableAdapters.ProductTableAdapter();
                this.tableAdapterManager = new Bonderbelegung.DSDataTableAdapters.TableAdapterManager();
                this.productBindingNavigator = new System.Windows.Forms.BindingNavigator(this.components);
                this.bindingNavigatorSeparator = new System.Windows.Forms.ToolStripSeparator();
                this.bindingNavigatorPositionItem = new System.Windows.Forms.ToolStripTextBox();
                this.bindingNavigatorCountItem = new System.Windows.Forms.ToolStripLabel();
                this.bindingNavigatorSeparator1 = new System.Windows.Forms.ToolStripSeparator();
                this.bindingNavigatorSeparator2 = new System.Windows.Forms.ToolStripSeparator();
                this.a2CProductTextBox = new System.Windows.Forms.TextBox();
                this.bindingNavigatorAddNewItem = new System.Windows.Forms.ToolStripButton();
                this.bindingNavigatorDeleteItem = new System.Windows.Forms.ToolStripButton();
                this.bindingNavigatorMoveFirstItem = new System.Windows.Forms.ToolStripButton();
                this.bindingNavigatorMovePreviousItem = new System.Windows.Forms.ToolStripButton();
                this.bindingNavigatorMoveNextItem = new System.Windows.Forms.ToolStripButton();
                this.bindingNavigatorMoveLastItem = new System.Windows.Forms.ToolStripButton();
                this.productBindingNavigatorSaveItem = new System.Windows.Forms.ToolStripButton();
                this.pictureBox1 = new System.Windows.Forms.PictureBox();
                a2CProductLabel = new System.Windows.Forms.Label();
                ((System.ComponentModel.ISupportInitialize)(this.dSData)).BeginInit();
                ((System.ComponentModel.ISupportInitialize)(this.productBindingSource)).BeginInit();
                ((System.ComponentModel.ISupportInitialize)(this.productBindingNavigator)).BeginInit();
                this.productBindingNavigator.SuspendLayout();
                ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
                this.SuspendLayout();
                // 
                // dSData
                // 
                this.dSData.DataSetName = "DSData";
                this.dSData.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
                // 
                // productBindingSource
                // 
                this.productBindingSource.DataMember = "Product";
                this.productBindingSource.DataSource = this.dSData;
                // 
                // productTableAdapter
                // 
                this.productTableAdapter.ClearBeforeFill = true;
                // 
                // tableAdapterManager
                // 
                this.tableAdapterManager.AdhesiveTableAdapter = null;
                this.tableAdapterManager.AreaTableAdapter = null;
                this.tableAdapterManager.ASICAdhesiveTableAdapter = null;
                this.tableAdapterManager.ASICTableAdapter = null;
                this.tableAdapterManager.BackupDataSetBeforeUpdate = false;
                this.tableAdapterManager.BondableSurfaceTableAdapter = null;
                this.tableAdapterManager.BondBelegungTableAdapter = null;
                this.tableAdapterManager.BonderProductTableAdapter = null;
                this.tableAdapterManager.BonderzuordnungLeftTableAdapter = null;
                this.tableAdapterManager.BondWireTableAdapter = null;
                this.tableAdapterManager.CustomerTableAdapter = null;
                this.tableAdapterManager.HousingTableAdapter = null;
                this.tableAdapterManager.LogTableAdapter = null;
                this.tableAdapterManager.LoopControlTableAdapter = null;
                this.tableAdapterManager.LoopParamsTableAdapter = null;
                this.tableAdapterManager.LoopTypeTableAdapter = null;
                this.tableAdapterManager.MEMSAdhesiveTableAdapter = null;
                this.tableAdapterManager.MEMSTableAdapter = null;
                this.tableAdapterManager.PresureSensorTypeTableAdapter = null;
                this.tableAdapterManager.ProductTableAdapter = this.productTableAdapter;
                this.tableAdapterManager.SupplierTableAdapter = null;
                this.tableAdapterManager.UpdateOrder = Bonderbelegung.DSDataTableAdapters.TableAdapterManager.UpdateOrderOption.InsertUpdateDelete;
                this.tableAdapterManager.vwBonderProductTableAdapter = null;
                this.tableAdapterManager.vwBonderProgramTableAdapter = null;
                this.tableAdapterManager.vwProgrammlistTableAdapter = null;
                this.tableAdapterManager.WedgeParamTableAdapter = null;
                this.tableAdapterManager.WireCutParamsTableAdapter = null;
                // 
                // productBindingNavigator
                // 
                this.productBindingNavigator.AddNewItem = this.bindingNavigatorAddNewItem;
                this.productBindingNavigator.BindingSource = this.productBindingSource;
                this.productBindingNavigator.CountItem = this.bindingNavigatorCountItem;
                this.productBindingNavigator.DeleteItem = this.bindingNavigatorDeleteItem;
                this.productBindingNavigator.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
                this.bindingNavigatorMoveFirstItem,
                this.bindingNavigatorMovePreviousItem,
                this.bindingNavigatorSeparator,
                this.bindingNavigatorPositionItem,
                this.bindingNavigatorCountItem,
                this.bindingNavigatorSeparator1,
                this.bindingNavigatorMoveNextItem,
                this.bindingNavigatorMoveLastItem,
                this.bindingNavigatorSeparator2,
                this.bindingNavigatorAddNewItem,
                this.bindingNavigatorDeleteItem,
                this.productBindingNavigatorSaveItem});
                this.productBindingNavigator.Location = new System.Drawing.Point(0, 0);
                this.productBindingNavigator.MoveFirstItem = this.bindingNavigatorMoveFirstItem;
                this.productBindingNavigator.MoveLastItem = this.bindingNavigatorMoveLastItem;
                this.productBindingNavigator.MoveNextItem = this.bindingNavigatorMoveNextItem;
                this.productBindingNavigator.MovePreviousItem = this.bindingNavigatorMovePreviousItem;
                this.productBindingNavigator.Name = "productBindingNavigator";
                this.productBindingNavigator.PositionItem = this.bindingNavigatorPositionItem;
                this.productBindingNavigator.Size = new System.Drawing.Size(800, 25);
                this.productBindingNavigator.TabIndex = 0;
                this.productBindingNavigator.Text = "bindingNavigator1";
                // 
                // bindingNavigatorSeparator
                // 
                this.bindingNavigatorSeparator.Name = "bindingNavigatorSeparator";
                this.bindingNavigatorSeparator.Size = new System.Drawing.Size(6, 25);
                // 
                // bindingNavigatorPositionItem
                // 
                this.bindingNavigatorPositionItem.AccessibleName = "Position";
                this.bindingNavigatorPositionItem.AutoSize = false;
                this.bindingNavigatorPositionItem.Name = "bindingNavigatorPositionItem";
                this.bindingNavigatorPositionItem.Size = new System.Drawing.Size(50, 23);
                this.bindingNavigatorPositionItem.Text = "0";
                this.bindingNavigatorPositionItem.ToolTipText = "Aktuelle Position";
                // 
                // bindingNavigatorCountItem
                // 
                this.bindingNavigatorCountItem.Name = "bindingNavigatorCountItem";
                this.bindingNavigatorCountItem.Size = new System.Drawing.Size(44, 22);
                this.bindingNavigatorCountItem.Text = "von {0}";
                this.bindingNavigatorCountItem.ToolTipText = "Die Gesamtanzahl der Elemente.";
                // 
                // bindingNavigatorSeparator1
                // 
                this.bindingNavigatorSeparator1.Name = "bindingNavigatorSeparator";
                this.bindingNavigatorSeparator1.Size = new System.Drawing.Size(6, 25);
                // 
                // bindingNavigatorSeparator2
                // 
                this.bindingNavigatorSeparator2.Name = "bindingNavigatorSeparator";
                this.bindingNavigatorSeparator2.Size = new System.Drawing.Size(6, 25);
                // 
                // a2CProductLabel
                // 
                a2CProductLabel.AutoSize = true;
                a2CProductLabel.Location = new System.Drawing.Point(46, 45);
                a2CProductLabel.Name = "a2CProductLabel";
                a2CProductLabel.Size = new System.Drawing.Size(67, 13);
                a2CProductLabel.TabIndex = 1;
                a2CProductLabel.Text = "A2CProduct:";
                // 
                // a2CProductTextBox
                // 
                this.a2CProductTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.productBindingSource, "A2CProduct", true));
                this.a2CProductTextBox.Location = new System.Drawing.Point(119, 42);
                this.a2CProductTextBox.Name = "a2CProductTextBox";
                this.a2CProductTextBox.Size = new System.Drawing.Size(100, 20);
                this.a2CProductTextBox.TabIndex = 2;
                // 
                // bindingNavigatorAddNewItem
                // 
                this.bindingNavigatorAddNewItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
                this.bindingNavigatorAddNewItem.Image = ((System.Drawing.Image)(resources.GetObject("bindingNavigatorAddNewItem.Image")));
                this.bindingNavigatorAddNewItem.Name = "bindingNavigatorAddNewItem";
                this.bindingNavigatorAddNewItem.RightToLeftAutoMirrorImage = true;
                this.bindingNavigatorAddNewItem.Size = new System.Drawing.Size(23, 22);
                this.bindingNavigatorAddNewItem.Text = "Neu hinzufügen";
                // 
                // bindingNavigatorDeleteItem
                // 
                this.bindingNavigatorDeleteItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
                this.bindingNavigatorDeleteItem.Image = ((System.Drawing.Image)(resources.GetObject("bindingNavigatorDeleteItem.Image")));
                this.bindingNavigatorDeleteItem.Name = "bindingNavigatorDeleteItem";
                this.bindingNavigatorDeleteItem.RightToLeftAutoMirrorImage = true;
                this.bindingNavigatorDeleteItem.Size = new System.Drawing.Size(23, 22);
                this.bindingNavigatorDeleteItem.Text = "Löschen";
                // 
                // bindingNavigatorMoveFirstItem
                // 
                this.bindingNavigatorMoveFirstItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
                this.bindingNavigatorMoveFirstItem.Image = ((System.Drawing.Image)(resources.GetObject("bindingNavigatorMoveFirstItem.Image")));
                this.bindingNavigatorMoveFirstItem.Name = "bindingNavigatorMoveFirstItem";
                this.bindingNavigatorMoveFirstItem.RightToLeftAutoMirrorImage = true;
                this.bindingNavigatorMoveFirstItem.Size = new System.Drawing.Size(23, 22);
                this.bindingNavigatorMoveFirstItem.Text = "Erste verschieben";
                // 
                // bindingNavigatorMovePreviousItem
                // 
                this.bindingNavigatorMovePreviousItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
                this.bindingNavigatorMovePreviousItem.Image = ((System.Drawing.Image)(resources.GetObject("bindingNavigatorMovePreviousItem.Image")));
                this.bindingNavigatorMovePreviousItem.Name = "bindingNavigatorMovePreviousItem";
                this.bindingNavigatorMovePreviousItem.RightToLeftAutoMirrorImage = true;
                this.bindingNavigatorMovePreviousItem.Size = new System.Drawing.Size(23, 22);
                this.bindingNavigatorMovePreviousItem.Text = "Vorherige verschieben";
                // 
                // bindingNavigatorMoveNextItem
                // 
                this.bindingNavigatorMoveNextItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
                this.bindingNavigatorMoveNextItem.Image = ((System.Drawing.Image)(resources.GetObject("bindingNavigatorMoveNextItem.Image")));
                this.bindingNavigatorMoveNextItem.Name = "bindingNavigatorMoveNextItem";
                this.bindingNavigatorMoveNextItem.RightToLeftAutoMirrorImage = true;
                this.bindingNavigatorMoveNextItem.Size = new System.Drawing.Size(23, 22);
                this.bindingNavigatorMoveNextItem.Text = "Nächste verschieben";
                // 
                // bindingNavigatorMoveLastItem
                // 
                this.bindingNavigatorMoveLastItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
                this.bindingNavigatorMoveLastItem.Image = ((System.Drawing.Image)(resources.GetObject("bindingNavigatorMoveLastItem.Image")));
                this.bindingNavigatorMoveLastItem.Name = "bindingNavigatorMoveLastItem";
                this.bindingNavigatorMoveLastItem.RightToLeftAutoMirrorImage = true;
                this.bindingNavigatorMoveLastItem.Size = new System.Drawing.Size(23, 22);
                this.bindingNavigatorMoveLastItem.Text = "Letzte verschieben";
                // 
                // productBindingNavigatorSaveItem
                // 
                this.productBindingNavigatorSaveItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
                this.productBindingNavigatorSaveItem.Image = ((System.Drawing.Image)(resources.GetObject("productBindingNavigatorSaveItem.Image")));
                this.productBindingNavigatorSaveItem.Name = "productBindingNavigatorSaveItem";
                this.productBindingNavigatorSaveItem.Size = new System.Drawing.Size(23, 22);
                this.productBindingNavigatorSaveItem.Text = "Daten speichern";
                this.productBindingNavigatorSaveItem.Click += new System.EventHandler(this.productBindingNavigatorSaveItem_Click);
                // 
                // pictureBox1
                // 
                this.pictureBox1.DataBindings.Add(new System.Windows.Forms.Binding("Image", this.productBindingSource, "Picture", true));
                this.pictureBox1.Location = new System.Drawing.Point(37, 80);
                this.pictureBox1.Name = "pictureBox1";
                this.pictureBox1.Size = new System.Drawing.Size(358, 244);
                this.pictureBox1.TabIndex = 3;
                this.pictureBox1.TabStop = false;
                // 
                // Test
                // 
                this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
                this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
                this.ClientSize = new System.Drawing.Size(800, 450);
                this.Controls.Add(this.pictureBox1);
                this.Controls.Add(a2CProductLabel);
                this.Controls.Add(this.a2CProductTextBox);
                this.Controls.Add(this.productBindingNavigator);
                this.Name = "Test";
                this.Text = "Test";
                this.Load += new System.EventHandler(this.Test_Load);
                ((System.ComponentModel.ISupportInitialize)(this.dSData)).EndInit();
                ((System.ComponentModel.ISupportInitialize)(this.productBindingSource)).EndInit();
                ((System.ComponentModel.ISupportInitialize)(this.productBindingNavigator)).EndInit();
                this.productBindingNavigator.ResumeLayout(false);
                this.productBindingNavigator.PerformLayout();
                ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
                this.ResumeLayout(false);
                this.PerformLayout();
    
            }
    
            #endregion
    
            private DSData dSData;
            private System.Windows.Forms.BindingSource productBindingSource;
            private DSDataTableAdapters.ProductTableAdapter productTableAdapter;
            private DSDataTableAdapters.TableAdapterManager tableAdapterManager;
            private System.Windows.Forms.BindingNavigator productBindingNavigator;
            private System.Windows.Forms.ToolStripButton bindingNavigatorAddNewItem;
            private System.Windows.Forms.ToolStripLabel bindingNavigatorCountItem;
            private System.Windows.Forms.ToolStripButton bindingNavigatorDeleteItem;
            private System.Windows.Forms.ToolStripButton bindingNavigatorMoveFirstItem;
            private System.Windows.Forms.ToolStripButton bindingNavigatorMovePreviousItem;
            private System.Windows.Forms.ToolStripSeparator bindingNavigatorSeparator;
            private System.Windows.Forms.ToolStripTextBox bindingNavigatorPositionItem;
            private System.Windows.Forms.ToolStripSeparator bindingNavigatorSeparator1;
            private System.Windows.Forms.ToolStripButton bindingNavigatorMoveNextItem;
            private System.Windows.Forms.ToolStripButton bindingNavigatorMoveLastItem;
            private System.Windows.Forms.ToolStripSeparator bindingNavigatorSeparator2;
            private System.Windows.Forms.ToolStripButton productBindingNavigatorSaveItem;
            private System.Windows.Forms.TextBox a2CProductTextBox;
            private System.Windows.Forms.PictureBox pictureBox1;
        }
    	
    	public partial class Test : Form
        {
            public Test()
            {
                InitializeComponent();
                dSData.Product.ProductRowChanging += Product_ProductRowChanging;
                dSData.Product.ProductRowChanged += Product_ProductRowChanged;
            }
    
            private void Product_ProductRowChanged(object sender, DSData.ProductRowChangeEvent e)
            {
                Console.WriteLine($"Produkt Row Changed RowState: {e.Row.RowState.ToString()}");
            }
    
            private void Product_ProductRowChanging(object sender, DSData.ProductRowChangeEvent e)
            {
                Console.WriteLine($"Produkt Row Changing RowState: {e.Row.RowState.ToString()}");
            }
    
            private void productBindingNavigatorSaveItem_Click(object sender, EventArgs e)
            {
                this.Validate();
                this.productBindingSource.EndEdit();
                this.tableAdapterManager.UpdateAll(this.dSData);
    
            }
    
            private void Test_Load(object sender, EventArgs e)
            {
                // TODO: Diese Codezeile lädt Daten in die Tabelle "dSData.Product". Sie können sie bei Bedarf verschieben oder entfernen.
                this.productTableAdapter.Fill(this.dSData.Product);
    
            }
        }
    }

    Freitag, 12. Juli 2019 12:37