FlexGrid iOS and WordWrap

Posted by: software on 11 April 2018, 2:17 pm EST

  • Posted 11 April 2018, 2:17 pm EST

    Hi everybody,

    I set the WordWrap Prop in an iOS FlexGrid Control:

    Grid.Columns.Add(new GridColumn { Binding = "User", Header = "User", Width = new GridLength(100), WordWrap = true, AllowResizing = true });

    Grid.Columns.Add(new GridColumn { Binding = "Titel", Header = "Titel", Width = GridLength.Star, WordWrap = true, AllowResizing = true });

    But is has no effect. Are there any additional settings required?

    Thanks
    Volker

  • Replied 12 April 2018, 11:06 am EST

    Hi Volker

    It looks like there is a bug on iOS. I noticed both wordwrap and autosizing rows seems like they're working incorrectly on this platform. Let me talk to the developers about it, and I'll keep you updated.

    Thanks

    Kelley
  • Replied 12 April 2018, 11:13 am EST

    Actually upon further testing autosizing works ok, the issue is just limited to the wordwrap property on iOS. I'll let you know when I hear more from development.

    Kelley
  • Replied 24 April 2018, 10:04 am EST

    Hi Volker

    We've pushed a hotfix (build 271) which should fix your problem. It should be available via NuGet.

    Kelley
  • Replied 4 May 2018, 4:36 am EST

    Hi Kelley,

    thanks for your help and the hotfix.

    I installed the new version (2.5.20181.271), but the WordWrap doesn't work in my case.

    Is there anything missing in my settings?

    myGrid.AutoGenerateColumns = false;
    myGrid.Rows.DefaultSize = 50;
    myGrid.AllowResizing = GridAllowResizing.Both;

    myGrid.Columns.Add(new GridColumn { Binding = "CreateDate", Header = "Create Date", Width = new GridLength(200) });
    myGrid.Columns.Add(new GridColumn { Binding = "CreateUser", Header = "Create User", Width = new GridLength(150), WordWrap = true });
    myGrid.Columns.Add(new GridColumn { Binding = "Text", Header = "Text", Width = GridLength.Star, WordWrap = true });

    Volker
  • Marked as Answer

    Replied 10 May 2018, 9:22 am EST

    Hi Volker,

    The WordWrap doesn't work because of the Row's DefaultSize you've set. Please comment out the line to set the DefaultSize and call the AutoSizeRows method of FlexGrid as below:

    myGrid.AutoSizeRows(0, myGrid.Rows.Count - 1);


    Thanks
  • Replied 15 May 2018, 10:16 am EST

    Perfect, now it's working!

    Thanks.
  • Replied 21 May 2018, 11:29 am EST

    I'm sorry, but after some testing I have to say it's not perfect.
    If the Grid was redrawn, for example after a column click for sorting or reloading additional data, the WordWrap Mode will be deactivated.

    Can you check that again?

    Thanks
    Volker
  • Replied 24 May 2018, 8:41 am EST

    Hi Volker,

    I could observe the behavior at my end as well. It seems there's an issue when the grid is redrawn. I'll let the developers know about this issue.
  • Replied 30 May 2018, 2:16 pm EST

    Hi Volker

    I think you need to adjust the code slightly to make sure this works. Change the line

    flexGrid1.AutoSizeRows(0, flexGrid1.Rows.Count - 1);     


    to

    flexGrid1.DefaultRowHeight = GridLength.Auto;   


    The first line only autosizes the rows once when the page initially loads, whereas the second sets a default height that automatically sizes whenever the layout changes. You could make the former case work too by also calling the AutoSizeRows method whenever the FlexGrid is sorted, but I think the second approach will be easier for you.

    Thanks

    Kelley
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels