I have a RadGridView in my main window. There is a datatrigger implemented to change the row's color to red when an "IsModified" property is set. This works well when the grid loads, but I have not been able to accomplish this from a window owned by the main window.
I have tried the following:
((Owner as MainPricingWindow).grdSearchResults.SelectedItem
as SecurityVO).IsModified = true;
That sets the property appropriately, but doesn't change the grid row style in the owner window. The ItemsSource of the grid is an ObservableCollection and the object (SecurityVO) implements INotifyPropertyChanged. The IsModified property calls raises the PropertyChanged event. All this seems to happen normally when the grid is loaded with some rows that have IsModified set. It will not change the row when the property is modified from a child window.
One additional thing I should add. The style fo the grid row in question is set via a DataTrigger. So the foreground color of the row is set if a particular property of the SecurityVO is set to true.
I guess I'm missing something. Any help would be appreciated.
Thanks.
5 Answers, 1 is accepted
There is actually a problem with the Foreground property only. Internally it is set explicitly on cells and that is why the triggers are not working. We are currently thinking of removing this limitation but it is still unknown when we will be able to do so.
Is is possible to use another property like background for the time being?
Kind regards,
Milan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Just wanted to inform you that we have fixed the Foreground binding problem. The fix will be available this Friday with our Latest Internal Build.
Greetings,
Milan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.

<tgrid:RadGridView AutoGenerateColumns="False" Grid.ColumnSpan="3" Grid.Column="0" Grid.Row="0" Grid.RowSpan="3" |
Name="grdSearchResults" ItemsSource="{Binding}" CanUserInsertRows="False" |
CanUserReorderColumns="False" CanUserSortColumns="False" ShowGroupPanel="False" |
IsReadOnly="True" MouseDoubleClick="Grid_MouseDoubleClick"> |
<tgrid:RadGridView.Resources> |
<Style TargetType="{x:Type teletheme:GridViewRow}"> |
<Style.Triggers> |
<DataTrigger Binding="{Binding Path=IsModified}" Value="True"> |
<DataTrigger.Setters> |
<Setter Property="Foreground" Value="Red"/> |
<!--<Setter Property="Background" Value="LightBlue"/>--> |
</DataTrigger.Setters> |
</DataTrigger> |
</Style.Triggers> |
</Style> |
</tgrid:RadGridView.Resources> |
<tgrid:RadGridView.Columns> |
<tgrid:GridViewDataColumn Header="Portfolio" DataMemberBinding="{Binding PortName}" Width="1.45*"/> |
<tgrid:GridViewDataColumn Header="Ticker" DataMemberBinding="{Binding Ticker}" Width="1*"/> |
<tgrid:GridViewDataColumn Header="Description" DataMemberBinding="{Binding Description}" Width="3*"/> |
<tgrid:GridViewDataColumn Header="Security ID" DataMemberBinding="{Binding SecurityID}" Width="1.5*"/> |
<tgrid:GridViewDataColumn Header="Price" DataMemberBinding="{Binding Price, Converter={StaticResource DecConverter}}" |
Width="1*"> |
</tgrid:GridViewDataColumn> |
<tgrid:GridViewDataColumn Header="Price Source" DataMemberBinding="{Binding PriceSourceCode}" Width="1.6*"/> |
</tgrid:RadGridView.Columns> |
</tgrid:RadGridView> |
As in an earlier post, I attempt to fire the data trigger from a window that is external and is owned by the window that has the grid on it. I use code like this:
// Update the grid to set the IsModified of the appropriate security |
((Owner as MainPricingWindow).grdSearchResults.SelectedItem as SecurityVO).IsModified = true; |
SecurityVO vo = ((Owner as MainPricingWindow).grdSearchResults.SelectedItem as SecurityVO); |
When I close the child window and inspect the grid in the main window, the background color is unchanged. If I use the foreground color, it does work as expected.
I have tried a similar scenario and it all worked correctly with ourbinaries from 11/16. I am sending you my test application - it is pretty much the same as yours, I just use another property for the DataTrigger.
Regards,
Milan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.

Just a tip, not sure if this has already been posted...
Once I replaced the binaries, I was pleasantly surprised to see that the new version had replaced the old in my "References" folder in my project. However, when I tried to run the application, I was getting XAML parsing errors that pointed to versioning differences. To solve this issue, I put modified the XAML and then took out the modification (anything will do, an extra character, a carriage return) and saved. That, I suppose, made a difference because I was able to run the application without any errors after that.