GetViewportTopRow is broken

Posted by: p.feenstra on 11 July 2021, 7:08 pm EST

  • Posted 11 July 2021, 7:08 pm EST

    After upgrading from r12 to r14 GetViewportTopRow always returns 0

    In r12 FpSpread1.GetViewportTopRow(0, 0) returned always the correct top row.

    Adding a Viewport gives the same result

    Environment

    • Win 10
    • VS 2019 Framework 4.8
    • databound sheets

    Regards Piet

  • Posted 11 July 2021, 7:59 pm EST

    Hi Piet,

    I tried GetViewportTopRow method in Spread 14 and 14.1, however I could not observe any issues.

    Please check the attached sample and let me know if I’m missing anything.

    ViewportTopRow.zip

    Also, please mention which version of Spread 14 you are using.

    Regards,

    Jitender

  • Posted 11 July 2021, 10:28 pm EST

    Jitender,

    Your sample works.

    I think it somehow is related to the other (previous) issue.

    Could it be how we bind to the db?

    I’m binding to the db as follows:

            DataSet ds = new DataSet(); 
            SheetView sv = fpSpread1.ActiveSheet;
            sv.AutoGenerateColumns = false;
            sv.DataAutoSizeColumns = false;
            sv.DataAutoHeadings = false;
            sv.DataMember = "data";
            oleDataAdapter.Fill(ds, "data");
            sv.DataSource = ds;
    

    Regards Piet

  • Posted 12 July 2021, 4:00 pm EST

    It can’t be because of the DataSet.

    I think it might be related to the previous issue as you’ve mentioned.

    Are you using GetViewportTopRow after inserting a row (which is somehow causing Spread to scroll to the top)?

    Regards,

    Jitender

Need extra support?

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

Learn More

Forum Channels