GridViewColumn Width behavior changed

5 posts, 1 answers
  1. Luc
    Luc avatar
    11 posts
    Member since:
    Feb 2013

    Posted 23 Nov 2015 Link to this post

    Hi,

     Since UI WPF Q3 2015, I notice change in the GridView column auto size. I have the following simple user control (with no height and width) :

     

    <UserControl x:Class="WpfApplication1.UserControl1"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                 xmlns:local="clr-namespace:WpfApplication1"
                 xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                 mc:Ignorable="d"
                 d:DesignHeight="300" d:DesignWidth="300">
        <Grid>
            <telerik:RadGridView AutoGenerateColumns="False">
                <telerik:RadGridView.Columns>
                    <telerik:GridViewDataColumn Header="Name" Width="150"/>
                    <telerik:GridViewDataColumn Header="Description" Width="*"/>
                </telerik:RadGridView.Columns>
            </telerik:RadGridView>
        </Grid>
    </UserControl>

    In my MainWindow I have a button which show a RadWindow with the UserControl content :

    private void OnClick(object sender, RoutedEventArgs e)
    {
        RadWindow window = new RadWindow();
        window.SizeToContent = true;
        window.Content = new UserControl1();
        window.SizeChanged += delegate
        {
            window.Header = string.Format("({0}, {1})", window.Height, window.Width);
        };
        window.ShowDialog();
    }

    In Telerik 2015.2.728.45, the RadWindow size is correct (like i expect in fact). In Telerik 2015.3.* the gridcolumn with Width="*" take all width possible (infinite?) and radwindow Width become infinite.

     

    What's the correct behavior ? Telerik 2015.2 or 2015.3 ? Do I need to set the UserControl size ? (I prefer to avoid this solution like my real application is more complex and expect to have an UserControl resize from its content).

    Thanks

    Regards

    Luc

  2. Stefan X1
    Admin
    Stefan X1 avatar
    523 posts

    Posted 26 Nov 2015 Link to this post

    Hi Luc,

    I am investigating what the cause of this issue might be, however I need more time for this. I will contact you as soon as I have a result.

    Thank you in advance for your patience.

    Regards,
    Stefan X1
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
  4. Luc
    Luc avatar
    11 posts
    Member since:
    Feb 2013

    Posted 08 Dec 2015 Link to this post

    Hi Stefan,

    For your information, windows are width over-sized not only for GridView. I have the same behaviour with RadRichTextBox for sample.

    Any clues ?

    Regards

  5. Answer
    Stefan X1
    Admin
    Stefan X1 avatar
    523 posts

    Posted 09 Dec 2015 Link to this post

    Hi Luc,

    Thank you for the additional information and please excuse me for the delayed reply.

    After investigating the issue, it seems that there has been a malfunction of the SizeToContent property of RadWindow as of 2015.2. With 2015.3 version it has been fixed, so the expected behavior in a scenario as yours would be the control to take all width possible.

    Best Regards,
    Stefan X1
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  6. Luc
    Luc avatar
    11 posts
    Member since:
    Feb 2013

    Posted 09 Dec 2015 in reply to Stefan X1 Link to this post

    Hi Stefan,

     

    Thank you for your answer, even if previous amlfunction was great for me :). I will set the size of window.

    Regards

Back to Top
UI for WPF is Visual Studio 2017 Ready