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

Fixed columns width + horizontral scrollbar

1 Answer 165 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Karel
Top achievements
Rank 1
Karel asked on 15 Jul 2014, 09:54 AM
Hello,

please, can you advise me the way how to do radgridview width fixed columns width (each column has different width set in XAML) which won't resize columns when application is resized? I just need columns to have the same width no matter what and to show horizontal scrollbar if app is too small.

Is there a way how to do this?

Thanks,
Karel 

1 Answer, 1 is accepted

Sort by
0
Boris
Telerik team
answered on 15 Jul 2014, 02:36 PM
Hello Karel,

A possible approach for setting all the columns to the same width is to set the ColumnWidth property of the GridView to "100" (your desired width,"*" or "Auto").
When the ColumnWidth property is set to a pixel value and you resize the application, the columns will not be resized. In addition, a horizontal ScrollBar will appear when the viewable area is too small to display all the columns.  

<telerik:RadGridView Grid.Row="0"
                             Name="clubsGrid"
                             ItemsSource="{Binding Clubs}"
                             AutoGenerateColumns="False"
                             ColumnWidth="100">
...
</telerik:RadGridView>

Also, I attached a sample project that demonstrates the suggested approach.

However, if you still have issues could you please modify the attached project in a way that it reproduces them?

Regards,
Boris Penev
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
GridView
Asked by
Karel
Top achievements
Rank 1
Answers by
Boris
Telerik team
Share this question
or