The hidden column appears after a resize

Posted by: david on 16 April 2024, 11:21 am EST

  • Posted 16 April 2024, 11:21 am EST

    Hello

    (((Spread Winforms - Spread version 15.0.20225.0 - MS Framework 4.6.2 - Visual Studio 2019)))

    If I hide a column and resize it, it reappears.

    Attached an example program (I deleted the license file in Zip file).

    1° Click button “Init”

    2° Click button “Hide Col (2]” (column(2] disappears)

    3° Click button resize (colmun[2] resize and reappears)

    Then if you hide column 2 again and then resize it, the column remains hidden.

    The problem therefore only occurs at the first iteration

    thksTestSpreadVisible.zip

  • Posted 17 April 2024, 5:37 am EST - Updated 17 April 2024, 5:43 am EST

    Hi David,

    Thanks for providing the sample application with environment details.

    This seems to be a bug with Spread.NET version 15 control. The issue is not replicable with the latest version of the spread control, i.e., v17.0.20242.0. Refer the following GIF:

    However, you can consider a workaround to set second column’s visibility to true before changing its width as shown below [for v15] :

    // Resize column
    private void BtnResize_Click(object sender, EventArgs e)
    {
        fpSpread1_Sheet1.Columns[2].Visible = true;
        fpSpread1_Sheet1.Columns[2].Width = 200;
        // idem if resize all colums fpSpread1_Sheet1.Columns[0, fpSpread1_Sheet1.Columns.Count - 1].Width = 50;
    }

    Kindly refer to the attached sample for full implementation. See TestSpreadVisible_Mod.zip

    Please note that this forum is specific to ComponentOne WinForms related queries. You can post your Spread.NET WinForms related queries on its particular forum: https://developer.mescius.com/forums/spread-winforms

    Thanks & Regards,

    Aastha

  • Posted 12 June 2024, 3:16 am EST

    Hi Aastha,

    I ask the opposite.

    I don’t want the hidden column to reappear after a resize (the column must remain hidden)…

    Thks

  • Posted 13 June 2024, 2:41 am EST - Updated 13 June 2024, 2:51 am EST

    Hi David,

    This is the intended behavior.

    When you set column’s width using the Column object, it implies that you want to see the column with mentioned width. Therefore, the Visible property sets to True internally.

    If you want to set the size only, you can set column width using model’s API. Here is the sample code:

    fpSpread1_Sheet1.Models.ColumnAxis.SetSize(2, 200);

    Please refer to the attached sample for implementation. See TestSpreadVisible_Mod.zip

    Thanks & Regards,

    Aastha

  • Posted 14 June 2024, 1:58 am EST - Updated 14 June 2024, 2:03 am EST

    it works. thanks.

    I just noticed that we always see a small space in the column header which corresponds to the hidden column (double lines). Is it possible to completely hide the column in the header without using the “LegacyBehaviors” property?

  • Posted 18 June 2024, 2:44 am EST

    I found the solution.

    You must set the ResizeZeroIndicator property of the spread to ‘Default’.

    fpSpread1.ResizeZeroIndicator = ResizeZeroIndicator.Default;
  • Posted 18 June 2024, 3:27 am EST

    Hi David,

    We are glad to hear that you found a solution to your requirement.

    Please let us know if you have any further doubts regarding this issue.

    Thanks & Regards,

    Aastha

Need extra support?

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

Learn More

Forum Channels