You can use =”{Binding}” to bind without specify any particular field. Some times when you are trying to use a Converter to return a calculated value based on more than one field in the record you can use this syntax to specify binding, so the value passed
to the IValueConverter will be the whole record of data which contains every fields.
Sorry, I'm super green with these concepts, but I'm fairly certain this is exactly what I want to do [change the background color of an entire row based on the content of one column]. Could you please give a xaml example of what you mean by the above paragraph?
For example, below I want to change the color of the background based on a given timestamp value... where would I put the ={Binding} to do this?
ssawchenko
Member
438 Points
214 Posts
Re: Re: Datagrid template column load event, strange behavior. Might be a bug
Sep 28, 2009 04:44 PM | LINK
Sorry, I'm super green with these concepts, but I'm fairly certain this is exactly what I want to do [change the background color of an entire row based on the content of one column]. Could you please give a xaml example of what you mean by the above paragraph?
For example, below I want to change the color of the background based on a given timestamp value... where would I put the ={Binding} to do this?
<Ctrls:DataGrid
x:Name="__TabDataGrid"
Grid.Row="1"
AutoGenerateColumns="False">
<Ctrls:DataGrid.Columns>
<Ctrls:DataGridTextColumn Header="Timestamp" Binding="{Binding TimeStamp}" />
<Ctrls:DataGridTextColumn Header="TL1" Binding="{Binding TL1Value}" />
<Ctrls:DataGridTextColumn Header="TL2" Binding="{Binding TL2Value}" />
</Ctrls:DataGrid.Columns>
</Ctrls:DataGrid>