Setting GridViewDataColumn Width to Star taking a huge space?

2 posts, 0 answers
  1. awt
    awt avatar
    5 posts
    Member since:
    Jul 2016

    Posted 12 Jul 2016 Link to this post

    The following is a simple RadGridView code where I want to set the width of the GridViewDataColumn width property to star:

    <UserControl x:Class="namespace1.UserControl1"

                    <telerik:GridViewDataColumn Width="*">
                                <TextBlock Text="Some text"/>


    The result of this code in the attachment where the column is taking a huge space and is not shrieked until I set MaxWidth property to some value. I am not sure if this is a correct behavior. Help Please? 

  2. Dilyan Traykov
    Dilyan Traykov avatar
    611 posts

    Posted 14 Jul 2016 Link to this post


    Setting a star-based width on a column means that it will take up all available space that is left after the other columns are measured. Since there are no other columns, in this case, the column will take up the whole width of your RadGridView unless told otherwise (by the MaxWidth property).

    So, the behavior you're getting is expected and you can override it by either setting a fixed width for your RadGridView instance or by setting a MaxWidth for your column.

    I hope you find this information helpful.

    Dilyan Traykov
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top