Gridview autosizemode Fill with horizontal scrollbar

Thread is closed for posting
3 posts, 0 answers
  1. 4BF8E90D-6C72-4ED8-85C6-8E2634D2F94D
    4BF8E90D-6C72-4ED8-85C6-8E2634D2F94D avatar
    14 posts
    Member since:
    Oct 2010

    Posted 21 Mar 2011 Link to this post

    Requirements

    RadControls version

     2011.1.11.315

    .NET version

     3.5 SP1

    Visual Studio version

    2010

    programming language

     C# and VB


    PROJECT DESCRIPTION

    I needed to have the gridview automatically auto sizing automatically to fill the entire space with most columns having fixed width and using one of the columns, usually the one that has the largest content to fill the rest of the empty space. Then the most important part is that the same variable width column, would have a minimum width so when the screen resolution is not enough to run the full size grid in will automatically change its behavior and show the horizontal scroll bar.

    This sample project shows exactly that.

    First set the width of the variable size column to the maximum, I used the radgrid width.

    Then add the SizeChanged event to show/hide the scrollbar accordingly.


    I hope this is helpfull to somebody.

    Thanks,

    -Gabriele
  2. F11ADD2A-840D-4563-BD9F-564CF2DD488A
    F11ADD2A-840D-4563-BD9F-564CF2DD488A avatar
    2911 posts
    Member since:
    Apr 2022

    Posted 24 Mar 2011 Link to this post

    Hello Gabriele,

    Thank you for sharing your solution with the community. I have added also VB version of your project to the same solution.

    I have updated your Telerik points for your efforts.

    Kind regards,
    Stefan
    the Telerik team
  3. BDE6F363-B839-4569-8674-72D1BB6DD162
    BDE6F363-B839-4569-8674-72D1BB6DD162 avatar
    1 posts
    Member since:
    Jun 2013

    Posted 26 Jun 2013 Link to this post



    Hello !

    thank you for your solution. Your work is simple and fast.

    Thank you very much.
Back to Top

This Code Library is part of the product documentation and subject to the respective product license agreement.