Resize the Column size and same time resize the rowsize

Posted by: satson90 on 8 September 2017, 3:06 pm EST

  • Posted 8 September 2017, 3:06 pm EST

    Hi


    I am changing column size programatically that time if i have large text in column it is hide, so that time i need to increase the row height.


    thanks


    sathish

  • Replied 8 September 2017, 3:06 pm EST

    Hi


    I am generate report using spread. In First time form is open the spread is dock fill the panel. i had one button also if i click that button another panel is visible that time i am change the width of first panel. In that time i need change the column width and row height 

  • Replied 8 September 2017, 3:06 pm EST

    Hello,

    I would like to clarify that the since spread is docked in panel, hence whenever we will increase the size of the panel spread's dimension would also increase.

    However, we have created a small sample to fulfill your requirements. Please have a look at the same and hope it helps.

    Thanks,

    Reeva


    2013/03/SpreadResizeColumn.zip
  • Replied 8 September 2017, 3:06 pm EST

     


    Hi Reeva,


    Thanks for a reply.


    Its not my concept. i need streach the column in spread sheet. if i am increase the size of spreadsheet the columns size also increased or i am decrease the size of spreadsheet the columns size also decreased


    thanks

  • Replied 8 September 2017, 3:06 pm EST

    Hello,

    You need to set the Row's Height and Column's Width as given below using  GetPreferredHeight() and GetPreferredWidth() method respectively.

      private void Form1_Load(object sender, EventArgs e)
            {
                this.fpSpread3.ActiveSheet.Cells[2, 3].Text = "test row height and column width";
                FarPoint.Win.Spread.StyleInfo si = new FarPoint.Win.Spread.StyleInfo();
                si.Font = new Font("Comic Sans MS", 16, FontStyle.Italic);
                fpSpread3.ActiveSheet.DefaultStyle = si;
                fpSpread3.ActiveSheet.Rows[2].Height = fpSpread3.ActiveSheet.Rows[2].GetPreferredHeight();
                fpSpread3.ActiveSheet.Columns[3].Width = fpSpread3.ActiveSheet.Columns[3].GetPreferredWidth();
            }

    Hope it helps.

    Thanks,

    Reeva

  • Replied 8 September 2017, 3:06 pm EST

    Hello,

    Please have a look at the attached sample wherein we have manually implemented the same on form resize event.

    Hope it helps.

    Thanks,

    Reeva


    2013/03/ResizeColumnsWithform_Spread.zip
  • Replied 8 September 2017, 3:06 pm EST

    Hi,


    Thanks for reply,


    Its Prefectly working


    thanks

Need extra support?

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

Learn More

Forum Channels