Problem with rendering when using FlexGrid

Posted by: stefan on 31 May 2018, 9:38 pm EST

  • Posted 31 May 2018, 9:38 pm EST

    Hello, I have a problem with rendering of my screen when using FlexGrid.
    We have a WebView above the grid to display some information to the user.
    On Windows UWP this webview remains blank if a FlexGrid is visible during screen creation.
    On Android the webview is reduced in height if a FlexGrid is visible during screen creation.
    If on Windows UWP we initially set IsVisble on the FlexGrid to false the WebView renders ok. If we then make the FlexGrid visible everything is fine.
    On Android this also works, but as soon as we lock/unlock the screen the WebView reduces in size again if the FlexGrid is visible.
    If we replace the FlexGrid by a ListView we do not have this problem. So it seems to be related to FlexGrid.
    Any ideas on what could be wrong here?

    Sample to illustrate this:
    Xaml:
    <StackLayout>
    <Button Text="Toggle" Clicked="Button_Clicked" />
    <WebView x:Name="htmlViewerTop" HorizontalOptions="FillAndExpand" VerticalOptions="Start" HeightRequest="100" />
    <Grid VerticalOptions="FillAndExpand">
    <c1:FlexGrid x:Name="c1FlexGridContent" />
    </Grid>
    </StackLayout>
    Code behind:
    	public MainPage()
    {
    InitializeComponent();
    var srcLst = Customer.GetCustomerList(100);
    c1FlexGridContent.ItemsSource = srcLst;
    var htmlSource = new Xamarin.Forms.HtmlWebViewSource();
    htmlSource.Html = @"<html><body><h1>Top html</h1><p>Shows the top info</p></body></html>";
    htmlViewerTop.Source = htmlSource;
    }

    private void Button_Clicked(object sender, EventArgs e)
    {
    c1FlexGridContent.IsVisible = !c1FlexGridContent.IsVisible;
    }
  • Marked as Answer

    Replied 1 June 2018, 5:08 pm EST

    I changed the XAML a bit and added the 2 WebView controls inside the Grid to make a 3-row Grid holding WebView controls and the FexGrid. After that it seems to work fine.
  • Replied 3 June 2018, 8:42 pm EST

    Glad to know you were able to get it working. Let us know if you need any other help
Need extra support?

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

Learn More

Forum Channels