Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
925
XamSpreadSheet maximum scrolling value
posted

Hi,

How I can control maximum value of horizontal scroll bar in the xamSpreadhsheet control? For what ever reasons I have around 5-10 columns in control but scrollbar shows very high value while all columns fits into the screen. How I can adjust this behavior?

Thanks in advance,

Tomas

Parents
No Data
Reply
  • 34810
    Offline posted

    Hello Tomas,

    My team and I have done an initial review of this support case, and I have some questions for you relating to the XamSpreadsheet and the Excel file you are placing inside it, as the behavior you are currently seeing is not the default, and there does not exist a way to control the “max scroll” of the XamSpreadsheet as it depends on the allocated cells. The default behavior can be seen in just about any of the XamSpreadsheet samples within the WPF Samples Browser that is installable with the product.

    Would it be possible for you to please answer the following?

    1. What is the container that you have the XamSpreadsheet placed inside of? By chance is it within a ScrollViewer / StackPanel / other control that measures with an infinite height/width?

    2. Are there other cells that may have had values in the Workbook that you are applying to the XamSpreadsheet than the ones in your screenshot? I ask this, as the XamSpreadsheet and the Excel Workbooks/Worksheets only actually allocate cells that have a value or have had a value and this is done for performance reasons, as allocating them all would be horrible for performance. A way you can check what cells (or how many) are allocated is to run the following foreach loop, where “sheet” is the active Worksheet of the XamSpreadsheet:

    foreach(var row in sheet.Rows)
    {
        System.Diagnostics.Debug.WriteLine("Row " + rowCount);

        foreach(var cell in row.Cells)
        {
            System.Diagnostics.Debug.WriteLine("Cell " + cellCount);
            cellCount++;
        }

        rowCount++;
    }

    Please let me know if you have any other questions or concerns on this matter.

Children