Using the 10.2 version of the grid or presenter i'm trying to add a datatrigger on the grid which does something visible, like making the font bold. This datatrigger should be databinded to a property of the dataitem but somehow i'm not able to figure this out in xaml. I found a multitrigger that listens to IsDataChanged and makes selectorDataChanged visible, but the value of this property is often false while the object is in fact dirty.
I tried several style's like
<Style TargetType="{x:Type igDP:RecordPresenter}"> <Style.Triggers> <DataTrigger Binding="{Binding DataItem.IsDirty}" Value="True"> <Setter Property="Background" Value="Green" /> </DataTrigger></Style.Triggers></Style>
but nothing works.. using TargetType igDP:DataPresenter or something else doesn't work either.
Thanks.
Setting the FontWeight to Bold within the datatrigger with binding on DataItem.IsDirty worked exactly as i wanted. The TargetType set to CellValuePresenter instead of DataRecordPresenter.Something else:What if i want the text within a cell to be bold when the property is dirty? I've a method called IsPropertyDirty(propertyName).. will i be able to set a trigger to that or do i have to make a dependency property foreach property?
Hello Raymond,
Have you tried targeting the same style for the CellValuePresenter instead of the DataRecordPresenter?
Creating a setter for the FontWeight property should bold the content of the cells in that row when IsDirty is true. Let me know if you have tried that already.
I am also from Europe so I am hoping any Europe team wins.
I figured it out
Orange because i'm from the netherlands and we're going to win the finals :)I have yet to figure out how to set the text font to bold.