binding doesnt work for the first time

1 posts, 0 answers
  1. CEM
    CEM avatar
    1 posts
    Member since:
    Dec 2011

    Posted 26 Dec 2011 Link to this post

    hi there,

    in row_loaded method, we create a multibinding for background. converter is not called in first run.

    -populate table (set binding in row_loaded)

    -set background on viewmodel

    -converter not called.

    -clear table

    -populate table (again create binding)

    -set background, then it is called.

    While in debug, when I checked PropertChanged.Target, in first run it is System.ComponentModel.PropertyChangedEventManager  (doesnt work),
    and in the second run, it is Telerik.Windows.Data.WeakEvent.WeakListener<System.ComponentModel.PropertyChangedEventArgs>.

    Telerik version : 2011.1.411.40

    MultiBinding multiBindingBackground = new MultiBinding();
                            multiBindingBackground.Converter = cellColorConverter;
                            Binding background = new Binding("Background");
                            background.Source = row.Item;                       
                            background.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
                            //background.Mode = BindingMode.TwoWay;
                            Binding isBackgroundForBackground = new Binding();
                            isBackgroundForBackground.Source = true;
                            multiBindingBackground.Bindings.Add(new Binding());
                            cellBase.SetBinding(GridViewCellBase.BackgroundProperty, multiBindingBackground);
Back to Top