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

Columns don't resize when IsFilteringAllowed is changed

6 Answers 101 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rick Glos
Top achievements
Rank 1
Rick Glos asked on 17 May 2011, 02:20 PM
I have a grid with the HorizontalAlignment set to left so that I get a nice compact grid.  When the grid is first loaded with data, the columns auto-size to properly fit the contents.  When the grid is first loaded, the IsFilteringAllowed is set to false and it is bound to a ViewModel for this property.

IsFilteringAllowed="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=DataContext.IsAdvancedUserInterfaceOn}"

We have allowed the user the ability to toggle this on and off.  When the user toggles it to true.  The columns properly resize to fit the filter indicator for each column.

However when the user toggles this off, setting the toggle to false, the indicator disappears, but the columns retain their size.  Here's a screenshot describing the issue.

I looked but I don't see a method to call to resize the columns back to their original size.  Can you help?

6 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 19 May 2011, 10:08 AM
Hi Rick Glos,

Can you try calling the InvalidateMeasure method of the grid. Maybe this will help.

Greetings,
Ross
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
Rick Glos
Top achievements
Rank 1
answered on 20 May 2011, 05:09 PM
This did not work for me.

I had to add an event to the ViewModel and subscribe to it from the View.  When it fires, I tried both InvalidateMeasure and UpdateLayout but neither seemed to have any effect.
0
Rossen Hristov
Telerik team
answered on 25 May 2011, 09:19 AM
Hi Rick Glos,

I am very very sorry for misleading you.

As it turns out, there is an issue. You can follow the PITS issue here: 1630. Unfortunately, I am not sure whether it will be possible for this behaviour to be changed.

Regards,
Ross
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
Rick Glos
Top achievements
Rank 1
answered on 25 May 2011, 03:36 PM
Thanks for your reply Ross.  At least you are aware of it.

BTW, your link above doesn't work: http://admin.telerik.com/?Context=Support&Control=~/UserControls/Support/Pits/SinglePitsIssue.ascx&PitsIssueId=1630.  Perhaps an internal url?
0
Rossen Hristov
Telerik team
answered on 25 May 2011, 03:57 PM
Hi Rick Glos,

Sorry, here is the correct one. You can vote for it.

All the best,
Ross
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
Rossen Hristov
Telerik team
answered on 25 May 2011, 04:00 PM
Hi Rick Glos,

Finally, this is the correct one. I was sending you the one for Silverlight. They are the same anyway, since we share 100% the same code-base between the two platforms.

All the best,
Ross
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
Tags
GridView
Asked by
Rick Glos
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Rick Glos
Top achievements
Rank 1
Share this question
or