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

[Solved] Binding in Background on columns

1 Answer 147 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
luke
Top achievements
Rank 1
luke asked on 11 Feb 2011, 10:31 AM
Hi, i've problem with bind color to Background of my column. I receive data from service, datacontract contain property SetColor of type  "Color", when im using binding like this, color won't bind. But when im set fixed color like Backgroud="Red"  its working.

 <telerikGridView:GridViewDataColumn  x:Name="ColorColumn2" Header="Test"  DataMemberBinding="{Binding TestData,StringFormat='F0'}" Background="{Binding SetColor}">

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 11 Feb 2011, 10:54 AM
Hello,

 If SetColor is a property of your data item this will not work since the DataContext of the columns is the same as the grid DataContext. You can define CellTemplate with desired control (for example TextBlock) and bind this control Background.

Greetings,
Vlad
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
GridView
Asked by
luke
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or