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

Gridview refresh or reset column size

2 Answers 342 Views
GridView
This is a migrated thread and some comments may be shown as answers.
yenkay
Top achievements
Rank 2
yenkay asked on 22 Apr 2010, 08:05 AM
Hi Telerik Team,

How to reset or refresh the Grid view to its original or default sizing mode ?

I set the column with mode to auto and I'm having custom filters to bind the data. If I altered the column sizes and perform another binding the column sizes are not reset.

I tried even binding null data source before binding the actual data. Is there a way to reset the sizing to auto on each binding.

thanks & regards
yenkay


2 Answers, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 26 Apr 2010, 09:25 AM
Hello,

Here is an example how to achieve this:
RadGridView1.Columns.OfType<Telerik.Windows.Controls.GridViewColumn>().ToList().ForEach(c => c.Width = GridViewLength.Auto);

You can check the attached application for reference.

Greetings,
Vlad
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
yenkay
Top achievements
Rank 2
answered on 26 Apr 2010, 02:54 PM
Thanks Vlad. That works great....
Tags
GridView
Asked by
yenkay
Top achievements
Rank 2
Answers by
Vlad
Telerik team
yenkay
Top achievements
Rank 2
Share this question
or