How to be notified when FrozenColumnCount is changed

5 posts, 0 answers
  1. Patrick
    Patrick avatar
    470 posts
    Member since:
    Aug 2012

    Posted 11 Apr 2012 Link to this post

    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
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 12 Apr 2012 Link to this post

    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 >>

  3. Patrick
    Patrick avatar
    470 posts
    Member since:
    Aug 2012

    Posted 12 Apr 2012 Link to this post

    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
  4. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 12 Apr 2012 Link to this post

    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 >>

  5. Patrick
    Patrick avatar
    470 posts
    Member since:
    Aug 2012

    Posted 12 Apr 2012 Link to this post

    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
Back to Top