Thanks for the link however I am still stuggling. I have implented the following class and added the resources to my page as below. But I cannot see how to set the style to the radribbonbutton that is within my datatemplate of the cell in my grid.
public class NotesButtonStyle : StyleSelector
{
public override Style SelectStyle(object item, DependencyObject container)
{
if (item is OBJECTIVEALL)
{
OBJECTIVEALL row = item as OBJECTIVEALL;
if (row.ManagerNotes == null && row.EmployeeNotes == null)
return NoNotes;
else
return HasNotes;
}
return null;
}
public Style HasNotes { get; set; }
public Style NoNotes { get; set; }
}
<UserControl.Resources>
<local:RatingMatcherStyle x:Key="ratingMatcherStyle">
<local:RatingMatcherStyle.RatingMisMatch>
<Style TargetType="telerik:GridViewCell">
<Setter Property="Foreground" Value="Red"></Setter>
</Style>
</local:RatingMatcherStyle.RatingMisMatch>
</local:RatingMatcherStyle>
<local:NotesButtonStyle x:Key="notesButtonStyle">
<local:NotesButtonStyle.HasNotes>
<Style TargetType="telerik:RadRibbonButton">
<Setter Property="SmallImage" Value="/Images/notes_empty.png"/>
</Style>
</local:NotesButtonStyle.HasNotes>
<local:NotesButtonStyle.NoNotes>
<Style TargetType="telerik:RadRibbonButton">
<Setter Property="SmallImage" Value="/Images/notes.png"/>
</Style>
</local:NotesButtonStyle.NoNotes>
</local:NotesButtonStyle>
</UserControl.Resources>