In This Topic
To prevent a header from truncating, users can configure the header to auto increase the row width just like in Excel.
Spread for Winforms provides support for automatic expansion of the width of the row header labels in order to accommodate the text when users scroll down past the rows (1,000, 10,000, etc.) in a spreadsheet.
While scrolling across the worksheet, Spread control extends the width of row header to display the row labels completely as per the following rules.
- The RowHeaderAutoWidthMax property of the FpSpread class can be used to enable the auto expand feature in the spreadsheet. This property indicates the maximum width that the row header can be extended to, as per the following points:
- By default, the value of the RowHeaderAutoWidthMax property is set to -1.
- If the value of this property is 0, it means that the auto expand feature is disabled.
- If the value of this property is set to a positive number, then the row header width must be less than equal to the RowHeaderAutoWidthMax.
- And, if the value of this property is set to a negative number, then the row header width will be automatically calculated by the Spread control.
- When the auto expand row header feature is enabled, the width of rowHeader.Columns [SheetView.RowHeaderAutoTextIndex] must be -1.
- If the row header contains multiple columns, there is only one column which shows the row index automatically (indicated by the RowHeaderAutoTextIndex property of the SheetView class). The auto expand feature works with that particular column only. And, to make this feature work, users must ensure that its width is set to -1.