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

binding doesnt work for the first time

0 Answers 33 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
CEM
Top achievements
Rank 1
CEM asked on 26 Dec 2011, 08:41 AM
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;
                        multiBindingBackground.Bindings.Add(background);
                        multiBindingBackground.Bindings.Add(rcBinding);
                        Binding isBackgroundForBackground = new Binding();
                        isBackgroundForBackground.Source = true;
                        multiBindingBackground.Bindings.Add(isBackgroundForBackground);
                        multiBindingBackground.Bindings.Add(new Binding());
                        cellBase.SetBinding(GridViewCellBase.BackgroundProperty, multiBindingBackground);

No answers yet. Maybe you can help?

Tags
General Discussions
Asked by
CEM
Top achievements
Rank 1
Share this question
or