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
15
Displaying a Worksheet, hiding columns and rows
posted

Hi there,

I am using UltraSpreadSheet and trying to have it display a worksheet to the user with no formula bar, no row column headers and only a certain range of rows and columns.  In this particular case, I want to display columns 1-5, and rows 40-200.  

I am using a For loop to set the hidden property to true or false, but running into an issue where I do not know the max number of rows or columns in the worksheet.

I tried using UltraSpreadsheet1.Workbook.Worksheets(1).Columns.Count and Rows.Count, but I get 0 and 484, respectively.  

Using the code:

For Counter As Integer = 4 To UltraSpreadsheet1.Workbook.Worksheets(1).Columns.Count - 1
     UltraSpreadsheet1.Workbook.Worksheets(1).Columns(Counter).Hidden = True
Next

Is there some property which will tell me the maximum number of rows or columns in a worksheet?  Or a way to set the maximum (this is how I was doing it using the previous spreadsheet control).  Having a heck of a time finding this in the documentation.

Thanks in advance!

Parents
No Data
Reply
  • 7435
    Offline posted

    Hello John ,

    You can hide the formula and column row header by using these proeprties:

    this.ultraSpreadsheet1.FormulaBar.Visible = false;
    this.ultraSpreadsheet1.AreHeadersVisible = false;
    this.ultraSpreadsheet1.Workbook.WindowOptions.TabBarVisible = false;

    Now about showing certain number of columns and rows i believe you should be using UltraGrid instead , is there specific reason you are using spreadsheet for that? 

    In the grid you can hide the column like this:

    this.ultraGrid1.DisplayLayout.Bands[0].Columns[0].Hidden = true;

Children
No Data