FlexGrid iOS and WordWrap

Posted by: software on 11 April 2018, 5:17 am EST

  • Posted 11 April 2018, 5:17 am 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?


  • Replied 12 April 2018, 2: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.


  • Replied 12 April 2018, 2: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.

  • Replied 24 April 2018, 1:04 am EST

    Hi Volker

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

  • Replied 3 May 2018, 7:36 pm 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 });

  • Marked as Answer

    Replied 10 May 2018, 12: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);

  • Replied 15 May 2018, 1:16 am EST

    Perfect, now it's working!

  • Replied 21 May 2018, 2: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?

  • Replied 23 May 2018, 11:41 pm 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, 5:16 am 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);     


    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.


Need extra support?

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

Learn More

Forum Channels