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

AutoResizeColumns support?

1 Answer 82 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jon Ronnenberg
Top achievements
Rank 1
Jon Ronnenberg asked on 14 Oct 2009, 03:00 PM
Hi all.

I'm new to Telerik WinForms which I'm using to produce a quick prototype. I'm looking for a simple way to populate a GridView but haven't found a simple way to adjust the columns. Initially I've tried to use the Property Builder to adjust the size of each column but then I can't assign a DataTable to the DataSource (which I understand is the preferred way of adding data to a grid) without adding new columns to the grid.
 
Then I stumbled upon AutoResizeColumns which seems to offer an alternative that would work but it doesn't look like RadGridView support this. If so, how do I add data to the grid without setting each column size in code?

Regards, Jon

1 Answer, 1 is accepted

Sort by
0
Jon Ronnenberg
Top achievements
Rank 1
answered on 14 Oct 2009, 05:30 PM
Ahh found it:
this.radGridView.MasterGridViewTemplate.AutoSizeColumnsMode = 
  Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill; 
This will do.
Tags
GridView
Asked by
Jon Ronnenberg
Top achievements
Rank 1
Answers by
Jon Ronnenberg
Top achievements
Rank 1
Share this question
or