Farpoint Designer product a wrong result

Posted by: liuzhc on 8 September 2017, 2:44 pm EST

  • Posted 8 September 2017, 2:44 pm EST

    1 Version:


    Farpoint.Win.Spread version 4.0.3510.2008


    Farpoint.Win.Spread.Designer version:4.0.3510.2008


    visual studio 2008


    2 Product step:


    1)run program


    2)click "Designer"buttong


    3)In spread Designer Window, select Sheet,change the rowCount Property's value to 1000,product a wrong Message:


    "the Property value is invalid"


    Detail Info:


    Invalid index specified:600


    current length is 500


    3 source code:


    Form.Designer.cs


    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;


    namespace Test
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }


            ///


            /// ??????
            ///

            public string FilePath
            {
                get { return Application.StartupPath + "\\bbbb.xml"; }
            }


            private void Button1_Click(object sender, EventArgs e)
            {
                FarPoint.Win.Spread.Design.DesignerMain d = new FarPoint.Win.Spread.Design.DesignerMain();
                d.AttachControl(this.fpSpread1);
                d.ShowDialog();
                if (d.DialogResult == DialogResult.OK)
                {


                    FarPoint.Win.Spread.Model.SpreadSerializer.SaveXml(this.fpSpread1, this.FilePath, false);
                }
                this.fpSpread1_Sheet1.DefaultStyle.Locked = true;
            }


            private void button1_Click(object sender, EventArgs e)
            {
                DialogResult result = MessageBox.Show("Delete Rows?", "Tip", MessageBoxButtons.OKCancel);
                if (result == DialogResult.OK)
                {
                    this.fpSpread1.Sheets[0].Protect = false;
                    FarPoint.Win.Spread.Model.CellRange range = this.fpSpread1.Sheets[0].GetSelection(0);
                    int rowStart = range.Row;
                    int rowCount = range.RowCount;
                    range = null;
                    this.fpSpread1.Sheets[0].RemoveRows(rowStart, rowCount);
                    //fpSpread1.Sheets[0].ClearRange(rowStart, 0, rowCount, fpSpread1.Sheets[0].ColumnCount, false);
                    //for (int i = rowStart + rowCount - 1; i >= rowStart; i--)
                    //{
                    //    fpSpread1.Sheets[0].MoveRow(i, fpSpread1.Sheets[0].RowCount - 1, true);
                    //}
                }


            }
        }
    }


    Form.cs


    using System.Windows.Forms;
    namespace Test
    {
        partial class Form1
        {
            ///


            /// ?????????
            ///

            private System.ComponentModel.IContainer components = null;


            ///


            /// ????????????
            ///

            /// ?????????,? true;??? false?
            protected override void Dispose(bool disposing)
            {
                if (disposing && (components != null))
                {
                    components.Dispose();
                }
                base.Dispose(disposing);
            }


            #region Windows ??????????


            ///


            /// ?????????? - ??
            /// ????????????????
            ///

            private void InitializeComponent()
            {
                this.Designer = new System.Windows.Forms.Button();
                this.fpSpread1 = new FarPoint.Win.Spread.FpSpread();
                this.fpSpread1_Sheet1 = new FarPoint.Win.Spread.SheetView();
                this.button1 = new System.Windows.Forms.Button();
                ((System.ComponentModel.ISupportInitialize)(this.fpSpread1)).BeginInit();
                ((System.ComponentModel.ISupportInitialize)(this.fpSpread1_Sheet1)).BeginInit();
                this.SuspendLayout();
                //
                // Designer
                //
                this.Designer.BackColor = System.Drawing.Color.WhiteSmoke;
                this.Designer.Font = new System.Drawing.Font("????", 9F);
                this.Designer.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(89)))), ((int)(((byte)(90)))), ((int)(((byte)(89)))));
                this.Designer.Location = new System.Drawing.Point(30, 12);
                this.Designer.Name = "Designer";
                this.Designer.Size = new System.Drawing.Size(75, 26);
                this.Designer.TabIndex = 0;
                this.Designer.Text = "design";
                this.Designer.UseVisualStyleBackColor = false;
                this.Designer.Click += new System.EventHandler(this.Button1_Click);
                //
                // fpSpread1
                //
                this.fpSpread1.AccessibleDescription = "fpSpread1, Sheet1, Row 0, Column 0, ";
                this.fpSpread1.BackColor = System.Drawing.SystemColors.Control;
                this.fpSpread1.Location = new System.Drawing.Point(30, 67);
                this.fpSpread1.Name = "fpSpread1";
                this.fpSpread1.RightToLeft = System.Windows.Forms.RightToLeft.No;
                this.fpSpread1.Sheets.AddRange(new FarPoint.Win.Spread.SheetView[] {
                this.fpSpread1_Sheet1});
                this.fpSpread1.Size = new System.Drawing.Size(535, 343);
                this.fpSpread1.TabIndex = 1;
                //
                // fpSpread1_Sheet1
                //
                this.fpSpread1_Sheet1.Reset();
                this.fpSpread1_Sheet1.SheetName = "Sheet1";
                // Formulas and custom names must be loaded with R1C1 reference style
                this.fpSpread1_Sheet1.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.R1C1;
                this.fpSpread1_Sheet1.RowCount = 600;
                this.fpSpread1_Sheet1.AllowNoteEdit = true;
                this.fpSpread1_Sheet1.RowHeader.Columns.Default.Resizable = false;
                this.fpSpread1_Sheet1.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.A1;
                //
                // button1
                //
                this.button1.Location = new System.Drawing.Point(206, 15);
                this.button1.Name = "button1";
                this.button1.Size = new System.Drawing.Size(75, 23);
                this.button1.TabIndex = 2;
                this.button1.Text = "Del Row";
                this.button1.UseVisualStyleBackColor = true;
                this.button1.Click += new System.EventHandler(this.button1_Click);
                //
                // Form1
                //
                this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
                this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
                this.ClientSize = new System.Drawing.Size(595, 438);
                this.Controls.Add(this.button1);
                this.Controls.Add(this.fpSpread1);
                this.Controls.Add(this.Designer);
                this.Name = "Form1";
                this.Text = "Form1";
                ((System.ComponentModel.ISupportInitialize)(this.fpSpread1)).EndInit();
                ((System.ComponentModel.ISupportInitialize)(this.fpSpread1_Sheet1)).EndInit();
                this.ResumeLayout(false);


            }


            #endregion


            private Button Designer;
            private FarPoint.Win.Spread.FpSpread fpSpread1;
            private FarPoint.Win.Spread.SheetView fpSpread1_Sheet1;
            private Button button1;
        }
    }


     


    2011/08/Test.rar
  • Replied 8 September 2017, 2:44 pm EST

    Hello,

    I was able to replicate the issue with Spread v4.0.3510, but the bug is fixed in the latest version of Spread v4.0.3526.2008. So, I would suggest you to update to the latest version to resolve the issue that you are facing. You can download the latest version from the following link:

                                                                          ftp://ftp.fpoint.com/SpreadWinForms4/

    Hope it will help you.

    Thanks,

    Manpreet Kaur.

                                                        


     

  • Replied 8 September 2017, 2:44 pm EST

    Thank you very much for your help.Big Smile


    Is there any pat h I can fix the issue without udate FP?


    When I get a spread from designer, and insert or delete rows in the sheet, I get a wrong tip like above. It is difficult to reproduct it, so I upload above project.


    Thanks again.

  • Replied 8 September 2017, 2:44 pm EST

    Hello,

    I could not find a workaround for the issue that you are facing, the best solution would be to update to the latest version of Spread v4.0.3526.2008.

    Thanks,

    Manpreet Kaur.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels