WPF Datagrid - Column Binding related to other columns
问题 I have a DataGrid with several Columns. Some of these columns are something like state|Color1|Color2|Color3|... I want to do this: If state==1 => RowForeground = Color1 If state==2 => RowForeground = Color2 If state==3 => RowForeground = Color3 ... The very first solution I can think is to use several Data Triggers: <DataTrigger Binding="{Binding Path=state}" Value="0"> <Setter Property="Foreground" Value="{Binding Path=color0, Converter={StaticResource str2clrConverter}}"/> </DataTrigger>