This is a migrated thread and some comments may be shown as answers.

Setting GridViewDataColumn Width to Star taking a huge space?

1 Answer 115 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
awt asked on 12 Jul 2016, 07:41 AM

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? 

1 Answer, 1 is accepted

Sort by
Dilyan Traykov
Telerik team
answered on 14 Jul 2016, 12:08 PM

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.
Asked by
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Share this question