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

    <P>1 Version:</P>
    <P>Farpoint.Win.Spread version 4.0.3510.2008</P>
    <P>Farpoint.Win.Spread.Designer version:4.0.3510.2008</P>
    <P>visual studio 2008</P>
    <P>2 Product step:</P>
    <P>1)run program</P>
    <P>2)click "Designer"buttong</P>
    <P>3)In spread Designer Window, select Sheet,change the rowCount Property's value to 1000,product a wrong Message:</P>
    <P>"the Property value is invalid"</P>
    <P>Detail Info:</P>
    <P>Invalid index specified:600</P>
    <P>current length is 500</P>
    <P>3 source code:</P>
    <P>Form.Designer.cs</P>
    <P>using System;<BR>using System.Collections.Generic;<BR>using System.ComponentModel;<BR>using System.Data;<BR>using System.Drawing;<BR>using System.Linq;<BR>using System.Text;<BR>using System.Windows.Forms;</P>
    <P>namespace Test<BR>{<BR>    public partial class Form1 : Form<BR>    {<BR>        public Form1()<BR>        {<BR>            InitializeComponent();<BR>        }</P>
    <P>        /// <summary><BR>        /// ??????<BR>        /// </summary><BR>        public string FilePath<BR>        {<BR>            get { return Application.StartupPath + "<A>\\bbbb.xml</A>"; }<BR>        }</P>
    <P>        private void Button1_Click(object sender, EventArgs e)<BR>        {<BR>            FarPoint.Win.Spread.Design.DesignerMain d = new FarPoint.Win.Spread.Design.DesignerMain();<BR>            d.AttachControl(this.fpSpread1);<BR>            d.ShowDialog();<BR>            if (d.DialogResult == DialogResult.OK)<BR>            {</P>
    <P>                FarPoint.Win.Spread.Model.SpreadSerializer.SaveXml(this.fpSpread1, this.FilePath, false);<BR>            }<BR>            this.fpSpread1_Sheet1.DefaultStyle.Locked = true;<BR>        }</P>
    <P>        private void button1_Click(object sender, EventArgs e)<BR>        {<BR>            DialogResult result = MessageBox.Show("Delete Rows?", "Tip", MessageBoxButtons.OKCancel);<BR>            if (result == DialogResult.OK)<BR>            {<BR>                this.fpSpread1.Sheets[0].Protect = false;<BR>                FarPoint.Win.Spread.Model.CellRange range = this.fpSpread1.Sheets[0].GetSelection(0);<BR>                int rowStart = range.Row;<BR>                int rowCount = range.RowCount;<BR>                range = null;<BR>                this.fpSpread1.Sheets[0].RemoveRows(rowStart, rowCount);<BR>                //fpSpread1.Sheets[0].ClearRange(rowStart, 0, rowCount, fpSpread1.Sheets[0].ColumnCount, false);<BR>                //for (int i = rowStart + rowCount - 1; i >= rowStart; i--)<BR>                //{<BR>                //    fpSpread1.Sheets[0].MoveRow(i, fpSpread1.Sheets[0].RowCount - 1, true);<BR>                //}<BR>            }</P>
    <P>        }<BR>    }<BR>}<BR></P>
    <P>Form.cs</P>
    <P>using System.Windows.Forms;<BR>namespace Test<BR>{<BR>    partial class Form1<BR>    {<BR>        /// <summary><BR>        /// ?????????<BR>        /// </summary><BR>        private System.ComponentModel.IContainer components = null;</P>
    <P>        /// <summary><BR>        /// ????????????<BR>        /// </summary><BR>        /// <param name="disposing">?????????,? true;??? false?</param><BR>        protected override void Dispose(bool disposing)<BR>        {<BR>            if (disposing && (components != null))<BR>            {<BR>                components.Dispose();<BR>            }<BR>            base.Dispose(disposing);<BR>        }</P>
    <P>        #region Windows ??????????</P>
    <P>        /// <summary><BR>        /// ?????????? - ??<BR>        /// ????????????????<BR>        /// </summary><BR>        private void InitializeComponent()<BR>        {<BR>            this.Designer = new System.Windows.Forms.Button();<BR>            this.fpSpread1 = new FarPoint.Win.Spread.FpSpread();<BR>            this.fpSpread1_Sheet1 = new FarPoint.Win.Spread.SheetView();<BR>            this.button1 = new System.Windows.Forms.Button();<BR>            ((System.ComponentModel.ISupportInitialize)(this.fpSpread1)).BeginInit();<BR>            ((System.ComponentModel.ISupportInitialize)(this.fpSpread1_Sheet1)).BeginInit();<BR>            this.SuspendLayout();<BR>            // <BR>            // Designer<BR>            // <BR>            this.Designer.BackColor = System.Drawing.Color.WhiteSmoke;<BR>            this.Designer.Font = new System.Drawing.Font("????", 9F);<BR>            this.Designer.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(89)))), ((int)(((byte)(90)))), ((int)(((byte)(89)))));<BR>            this.Designer.Location = new System.Drawing.Point(30, 12);<BR>            this.Designer.Name = "Designer";<BR>            this.Designer.Size = new System.Drawing.Size(75, 26);<BR>            this.Designer.TabIndex = 0;<BR>            this.Designer.Text = "design";<BR>            this.Designer.UseVisualStyleBackColor = false;<BR>            this.Designer.Click += new System.EventHandler(this.Button1_Click);<BR>            // <BR>            // fpSpread1<BR>            // <BR>            this.fpSpread1.AccessibleDescription = "fpSpread1, Sheet1, Row 0, Column 0, ";<BR>            this.fpSpread1.BackColor = System.Drawing.SystemColors.Control;<BR>            this.fpSpread1.Location = new System.Drawing.Point(30, 67);<BR>            this.fpSpread1.Name = "fpSpread1";<BR>            this.fpSpread1.RightToLeft = System.Windows.Forms.RightToLeft.No;<BR>            this.fpSpread1.Sheets.AddRange(new FarPoint.Win.Spread.SheetView[] {<BR>            this.fpSpread1_Sheet1});<BR>            this.fpSpread1.Size = new System.Drawing.Size(535, 343);<BR>            this.fpSpread1.TabIndex = 1;<BR>            // <BR>            // fpSpread1_Sheet1<BR>            // <BR>            this.fpSpread1_Sheet1.Reset();<BR>            this.fpSpread1_Sheet1.SheetName = "Sheet1";<BR>            // Formulas and custom names must be loaded with R1C1 reference style<BR>            this.fpSpread1_Sheet1.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.R1C1;<BR>            this.fpSpread1_Sheet1.RowCount = 600;<BR>            this.fpSpread1_Sheet1.AllowNoteEdit = true;<BR>            this.fpSpread1_Sheet1.RowHeader.Columns.Default.Resizable = false;<BR>            this.fpSpread1_Sheet1.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.A1;<BR>            // <BR>            // button1<BR>            // <BR>            this.button1.Location = new System.Drawing.Point(206, 15);<BR>            this.button1.Name = "button1";<BR>            this.button1.Size = new System.Drawing.Size(75, 23);<BR>            this.button1.TabIndex = 2;<BR>            this.button1.Text = "Del Row";<BR>            this.button1.UseVisualStyleBackColor = true;<BR>            this.button1.Click += new System.EventHandler(this.button1_Click);<BR>            // <BR>            // Form1<BR>            // <BR>            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);<BR>            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;<BR>            this.ClientSize = new System.Drawing.Size(595, 438);<BR>            this.Controls.Add(this.button1);<BR>            this.Controls.Add(this.fpSpread1);<BR>            this.Controls.Add(this.Designer);<BR>            this.Name = "Form1";<BR>            this.Text = "Form1";<BR>            ((System.ComponentModel.ISupportInitialize)(this.fpSpread1)).EndInit();<BR>            ((System.ComponentModel.ISupportInitialize)(this.fpSpread1_Sheet1)).EndInit();<BR>            this.ResumeLayout(false);</P>
    <P>        }</P>
    <P>        #endregion</P>
    <P>        private Button Designer;<BR>        private FarPoint.Win.Spread.FpSpread fpSpread1;<BR>        private FarPoint.Win.Spread.SheetView fpSpread1_Sheet1;<BR>        private Button button1;<BR>    }<BR>}</P>
    <P> </P>
    2011/08/Test.rar
  • Replied 8 September 2017, 2:44 pm EST

    <p>Hello,</p><p>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:</p><p>                                                                      ftp://ftp.fpoint.com/SpreadWinForms4/</p><p>Hope it will help you.</p><p>Thanks,</p><p>Manpreet Kaur. <br></p><p>                                                     <br></p><h4 class="ForumPostHeader"><br></h4><p> </p>
  • Replied 8 September 2017, 2:44 pm EST

    <P>Thank you very much for your help.<img src="/emoticons/emotion-2.gif" alt="Big Smile" /></P>
    <P>Is there any pat h I can fix the issue without udate FP?</P>
    <P>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.</P>
    <P>Thanks again.</P>
  • Replied 8 September 2017, 2:44 pm EST

    <p>Hello,</p><p>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.</p><p>Thanks,</p><p>Manpreet Kaur. <br></p>
Need extra support?

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

Learn More

Forum Channels