How to enable MeasureTextOnRender?

2 posts, 0 answers
  1. HFP
    HFP avatar
    6 posts
    Member since:
    Jul 2011

    Posted 09 Oct 2017 Link to this post

    How can (resp. should) I enable the MeasureTextOnRender property?

     

    myRadVirtualGrid.MeasureTextOnRender = true;

    for (int i = 0; i < myRadVirtualGrid.InitialColumnCount; i++)
    {
        myRadVirtualGrid.FitColumnWidthToContent(i);
    }

     

    It seems to be quite simple, but crashes (unclear exception).

    This exception comes from "myRadVirtualGrid.MeasureTextOnRender = true;" only ...

    Any idea how to fix it?

    Or at least a working example for using the FitColumnWidthToContent method?

    Thanks a lot in advance!

    Hagen

  2. Yoan
    Admin
    Yoan avatar
    1133 posts

    Posted 10 Oct 2017 Link to this post

    Hello Hagen,

    We will try to fix this exception as soon as possible. However, you need to use the Loaded event of the VirtualGrid. Please check the following code snippet for a reference:
    void vg_Loaded(object sender, RoutedEventArgs e)
         {
             for (int i = 0; i < vg.InitialColumnCount; i++)
             {
                 vg.FitColumnWidthToContent(i);
             }
         }

    P.S. Your Telerik points were updated.

    Regards,
    Yoan
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top