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

How to be notified when FrozenColumnCount is changed

4 Answers 57 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Patrick
Top achievements
Rank 2
Iron
Iron
Iron
Patrick asked on 11 Apr 2012, 03:56 PM
Hello,
I would like to save the columns layout of a GridView when they qre changed by the user. I have the ColumnReordered and ColumnWidthChanged events to know when the order of the columns or the width of a column is changed, but how can I be notified when the FrozenColumnCount property is changed?
I've tried with the PropertyChanged event, but it is not raised in this case.
Is there a simple solution to this, without hacking the control?
Patrick

4 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 12 Apr 2012, 07:59 AM
Hello,

 You can TwoWay bind this property to your view-model.

Regards,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Patrick
Top achievements
Rank 2
Iron
Iron
Iron
answered on 12 Apr 2012, 08:19 AM
Hello Vlad,
that's the answer I fear, because it means many code for just this.
The GridView control implements the PropertyChanged event (it inherits it from Telerik.Windows.Controls.GridView.BaseItemsControl), why doesn't it notify for the change of this property?
Patrick
0
Pavel Pavlov
Telerik team
answered on 12 Apr 2012, 08:53 AM
Hi Patrick,

Since the Silverlight world favors bindings over handling events we have always considered dependency properties as the "better INotifyPropertyChanged".

In your case I may recommend the approach found on this StackOverflow thread.

All the best,
Pavel Pavlov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Patrick
Top achievements
Rank 2
Iron
Iron
Iron
answered on 12 Apr 2012, 09:09 AM
Hello Pavel,
Silverlight favors bindings to update UI elements and classes when they are bound, not to be notified of property changes. For example, the Silverlight Control class defines the IsEnabledChanged event to be notified of changes in the IsEnabled property.
Dependency properties are great in WPF, where you can be notified of a change. But you can't be notified in Silverlight: you had to do a hack to just have this information and it adds memory consumption and slows the application.
I recall you that GridView implements a PropertyChanged event and it is not used in this case!

In my case, I just want to be notified of the change, so the user settings can be saved on the server. To implement just this simple thing, I need to define a new dependency property and bind it to an existing one, just to be notified of a change!!!!!

Patrick
Tags
GridView
Asked by
Patrick
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Vlad
Telerik team
Patrick
Top achievements
Rank 2
Iron
Iron
Iron
Pavel Pavlov
Telerik team
Share this question
or