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

Grid auto-resize to form resize

1 Answer 837 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Strategon
Top achievements
Rank 1
Strategon asked on 19 Dec 2012, 05:38 PM

I would like for my grid to autosize according to the form size. When the form is resized, I would like the grid to expand. Is there a setting for this anywhere?

1 Answer, 1 is accepted

Sort by
0
Anton
Telerik team
answered on 21 Dec 2012, 12:02 PM
Hello Derek,

Thank you for writing.

You can achieve the desired behavior by docking your RadGridView to the form. Just set its Dock property to Fill and you grid will be resizing every time when its parent is resizing. For example:
this.radGridView1.Dock = System.Windows.Forms.DockStyle.Fill;

Also you can make the grid's columns to resize every time the grid is resizing with the follow code snippet:
this.radGridView1.MasterTemplate.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;
Attached is a demo project.

I hope this helps.

All the best,
Anton
the Telerik team
Q3’12 of RadControls for WinForms is available for download (see what's new). Get it today.
Tags
GridView
Asked by
Strategon
Top achievements
Rank 1
Answers by
Anton
Telerik team
Share this question
or