ReoGrid Forum

Fast and powerful .NET Spreadsheet Component

You are not logged in.

Announcement

This forum has been archived and no longer accepts new user registrations. Please report your questions, problems, and feedback to the issue page of ReoGrid on GitHub. Thank you for your cooperation.

https://github.com/unvell/ReoGrid/issues

#1 2017-02-27 21:59:04

Kesha
Member
Registered: 2017-02-27
Posts: 1

Edit_AutoExpandRowHeight doesn't work in WPF

Hello!

First, I'd like to thank you for ReoGridControl, it is a big help for me, for my work projects. smile

Second, unfortunately I faced a problem with Edit_AutoExpandRowHeight option. I use last available ReoGrid release 2.0.0.0 WPF edition. In my solution I need cell heights dynamically changed depending on the cell content while user editing.

For example, I want first row height auto expand depending on the 'A1' cell data. In my WPF project I do necessary settings as wrote in doci:

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            // I. A1 'Word Break' Wrap Mode
            Worksheet worksheet = grid.CurrentWorksheet;
            Cell cell = worksheet.Cells["A1"];

            WorksheetRangeStyle style = new WorksheetRangeStyle();
            style.Flag = PlainStyleFlag.LayoutAll;
            style.TextWrapMode = TextWrapMode.WordBreak;

            grid.CurrentWorksheet.SetRangeStyles(cell.PositionAsRange, style);

            // II. Enable Edit_AutoExpandRowHeight
            grid.CurrentWorksheet.EnableSettings(WorksheetSettings.Edit_AutoExpandRowHeight);
        }

But when I input 'VeryLongText' in 'A1' cell I see that display text is cutted off and row height didn't auto expanded. So text displayed in cell looks like 'VeryLongT...'.

I tried to use forced auto fit, but it didn't help, nothing changed.

        private void btnAction_Click(object sender, RoutedEventArgs e)
        {
            Worksheet worksheet = grid.CurrentWorksheet;

            // Attempt I
            worksheet.AutoFitRowHeight(0);

            // Attempt II
            grid.CurrentWorksheet.GetRowHeader(0).FitHeightToCells();
        }

(By the way, I noticed that XML-definition summary of FitHeightToCells method is 'Auto fit column width to largest cell on this column.'. Sorry, I don't want to chicane, but is this right summary?)

So could you say - I did something wrong or it is some kind of error?

Regards!

Offline

#2 2017-05-04 01:11:11

Jingwood
Moderator
From: jing at reogrid.net
Registered: 2014-06-03
Posts: 615

Re: Edit_AutoExpandRowHeight doesn't work in WPF

Offline

Board footer

Powered by FluxBB