Skip to content

Demonstrates binding paths used to access cell values and ViewModel properties.

License

Notifications You must be signed in to change notification settings

DevExpress-Examples/how-to-build-binding-paths-in-gridcontrol-rows

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Binding Paths in WPF Data Grid Rows

image

Row elements contain RowData objects in their DataContext. Use the following binding paths to access cell values and ViewModel properties:

The bindings used in this example work as follows:

  • Bind the row Background to the Color property stored at the item level:
<Trigger Property="SelectionState" Value="None">
    <Setter Property="Background" Value="{Binding Row.Color, Converter={dxmvvm:ColorToBrushConverter}}" />
</Trigger>
  • Highlight a row when the HighlightVisited property of the grid's ViewModel and the Visited column value are true:
<MultiDataTrigger>
    <MultiDataTrigger.Conditions>
        <Condition Binding="{Binding View.DataContext.HighlightVisited}" Value="True" />
        <Condition Binding="{Binding DataContext.Visited}" Value="True" />
    </MultiDataTrigger.Conditions>
    <Setter Property="TextElement.FontStyle" Value="Italic" />
    <Setter Property="TextElement.FontWeight" Value="Bold" />
</MultiDataTrigger>

Files to Look at

Documentation

More Examples

About

Demonstrates binding paths used to access cell values and ViewModel properties.

Topics

Resources

License

Stars

Watchers

Forks