Fixed columns width + horizontral scrollbar

2 posts, 0 answers
  1. Karel
    Karel avatar
    11 posts
    Member since:
    Aug 2011

    Posted 15 Jul 2014 Link to this post

    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 
  2. Boris
    Admin
    Boris avatar
    276 posts

    Posted 15 Jul 2014 Link to this post

    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.
     
Back to Top