Spreadsheet horizontal scrolling behaviour

1 Answer 97 Views
Spreadsheet
Ian
Top achievements
Rank 2
Bronze
Iron
Iron
Ian asked on 19 May 2023, 07:47 AM

When I load data into  my sheets, where there are columns which have a lot of data  (long descriptions of things)  and I use 'autoFitWidth to make things look sensible, I end up with some very wide columns, as expected.

Where a column is wider than the viewable area, left and right scroll often don't do anything: the sheet still shows one column. It seems to want to show all of a column, so after a while, it jumps to the next wide column.

(zipped video below)

This is strange behaviour, and also means that my users can not figure out how to re-size one of these wide columns, and then use word wrapping to make it easier to read.

Have I done something bad to my data to make it do this ? Or is there a setting somewhere to make the scrolling smooth?

Thanks

1 Answer, 1 is accepted

Sort by
0
Anna
Telerik team
answered on 19 May 2023, 12:28 PM

Hi,

You can use the ScrollMode properties of the RadWorksheetEditor, like so:

this.radSpreadsheet.SpreadsheetElement.ActiveWorksheetEditor.HorizontalScrollMode = ScrollMode.PixelBased;

This will make the control scroll on pixel by pixel basis, rather than by columns.

Also, if you'd like to wrap the content of wider columns, you can use something like this:

double maxValue = 700;

ColumnWidth width = ws.Columns[0].GetWidth().Value;
if(width.Value > maxValue)
{
      ws.Columns[0].SetWidth(new ColumnWidth(maxValue, width.IsCustom));
      ws.Columns[0].SetIsWrapped(true);
}

I hope this helps, please let me know if there is anything else I can help you with or if you encounter any issues implementing the solution.

Regards,
Anna
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Ian
Top achievements
Rank 2
Bronze
Iron
Iron
commented on 19 May 2023, 01:21 PM

Perfect!

Thanks

Tags
Spreadsheet
Asked by
Ian
Top achievements
Rank 2
Bronze
Iron
Iron
Answers by
Anna
Telerik team
Share this question
or