How to check row is hidden or not

Posted by: tegbir.singh on 26 July 2024, 9:29 am EST

    • Post Options:
    • Link

    Posted 26 July 2024, 9:29 am EST - Updated 26 July 2024, 9:34 am EST

    Hi, we are using Farpoint.Win.Spread (version 12.45.20191.0) control in our windows application. In our application, we have a feature to import an excel file with data which can be opened in spread through our application to input some data and create dynamic reports. We also have a feature to display the rows based on the filter logic in spread. With default filter, we display all the rows which are visible in spread and we use GetRowVisible method to check the visibility of the row.

    Suppose we have rows from 1st to 25th in excel and grouping with collapse mode is applied on 25th row (which contains rows from 4th to 24th as hidden) and other rows (1,2,3) are visible in the sheet. For more info, please check the attached excel file as well.

    Currently, we are facing an issue of showing the rows from (4th to 24th) when grouping is collapsed in excel because in excel grouping is applied in collapsed mode and our logic (GetRowVisible mehod) returns the result false for collapsed rows (row 4 to 24th).

    Is there any way to find the rows which are under the collapsed grouping but not hidden in the spread so that we can display them even when grouping is in collapsed mode in excel? Please help.

    As a workaround, this works when we import excel with all grouping in expanded mode.

  • Posted 29 July 2024, 2:37 am EST

    Hi Tegbir,

    >For more info, please check the attached excel file as well.

    It seems that you forgot to attach the excel file that you have mentioned about. Could you please attach the excel file so that we can understand your use-case better?

    Thanks & Regards,

    Aastha

  • Posted 29 July 2024, 2:38 am EST - Updated 29 July 2024, 3:56 am EST

    Hi Aastha,

    Please find attached excel for your reference.

    Sample.zip

    Please provide an alternate solution how to check a row is collapsed which is not hidden on the sheet.

    //desktop code to identify hidden rows

    if (!area.HiddenRowsDone)

    {

    for (var i = area.AreaBeginRow; i <= area.AreaEndRow; i++)

    if (!form.RowVisible(sheetNo, i))

    //Put row to hidden rows collection

    if (!sheet.HiddenRowsTable.Contains(i))

    sheet.HiddenRowsTable.Add(i);

    area.HiddenRowsDone = true;

    }

    public virtual bool RowVisible(int sheetNo, int row)

    {

    return form.InpRptSpread.RowVisible(sheetNo, row);

    }

    //below code is for spreadjs web

    public override bool RowVisible(int sheetNo, int row)

    {

    return !form.GCInpRptSpread.Worksheets[sheetNo].Rows[row].Hidden;

    }

  • Posted 29 July 2024, 9:37 am EST

    Hi Tegbir,

    You can check the visibility of a row by using the following line of code:

    fpSpread1.ActiveSheet.Rows[rowIndex].Visible

    We have attached a sample application for your reference. See

    CollapsedRow.zip

    Please note that Spread.NET v12 is very old and out of support now. We would suggest you upgrade to the latest version in order to get the latest features, updates and support.

    In case your requirement differs from our understanding, kindly share a stripped-down version of your sample application along with some more information about the desired behavior. Additionally, please confirm the technology you are working with.

    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