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

MultiBinding on GridViewColumn??

2 Answers 234 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Bastien
Top achievements
Rank 1
Bastien asked on 15 Jun 2011, 11:33 AM
Hi!

I've a very simple problem but apparently GridViewDataColumn is not part of FrameworkElement and causes the MultiBinding to crash.

What I want to do is pretty simple. I have 2 'integer' columns (side by side) and I want to put a different background/border on these cells if the value inside it are not the same.

I tried that:
<telerik:GridViewDataColumn
                        Header="Proposed"
                        DataMemberBinding="{Binding ProposedQuantity, Mode=TwoWay}"
                        SortMemberPath="ProposedQuantity"
                        Width=".15*">
                        <local:BindingUtil.MultiBindings>
                            <local:MultiBindings>
                                <local:MultiBinding
                                    TargetProperty="Background"
                                    Converter="{StaticResource valuesToBackgroundColorConverter}">
                                    <local:MultiBinding.Bindings>
                                        <local:BindingCollection>
                                            <Binding
                                                Path="RequestedQuantity" />
                                            <Binding
                                                Path="ProposedQuantity" />
                                        </local:BindingCollection>
                                    </local:MultiBinding.Bindings>
                                </local:MultiBinding>
                            </local:MultiBindings>
                        </local:BindingUtil.MultiBindings>
                    </telerik:GridViewDataColumn>

I know I could simply bind on the entire object and check the 2 properties in a converter BUT what if my values are changing in code-behind???? The object will not be notified of these changes and the grid will not be updated!

Do you have a solution for this kind of problem?

Thanks,
Bastien

2 Answers, 1 is accepted

Sort by
0
Accepted
Milan
Telerik team
answered on 16 Jun 2011, 07:24 AM
Hi Bastien Chételat,

You could try using Cell Style Selectors to have such dynamic styling. 


Best wishes,
Milan
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
Bastien
Top achievements
Rank 1
answered on 16 Jun 2011, 11:17 AM
Perfect solution, thx :-)!
Tags
GridView
Asked by
Bastien
Top achievements
Rank 1
Answers by
Milan
Telerik team
Bastien
Top achievements
Rank 1
Share this question
or