1
사전 경고 죄송 WPF 새로운 사람 :WPF DataGrid에 데이터 바인딩 DataView를
나는 DataTable을의 기본보기 내가 열 이름을 알고
ResultDataGrid.ItemsSource = resultTable.DefaultView;
에 바인딩 된 데이터 그리드를 가지고 있고, 나는을 변경해야 칼럼의 전경 다른 열이 1
경우 (항상 0 또는 1) 현재
내가 무엇을 :
및 XAML에서: otherColumnName이 생성자 XAML 스타일이 올바른 경로가없는 것 같다
public ResultsCustom(DataTable resultclass, CustomQuery query)
{
// Some other stuff
this.Resources.Add("otherColumnName", COLUMN_NAME);
}
에 설정되어
<Window.Resources>
<Style TargetType="DataGridCell" x:Key="columnStyle">
<Setter Property="Foreground" Value="Black"/>
<Style.Triggers>
<DataTrigger Binding="{Binding resultTable, Path={StaticResource otherColumnName}}" Value="1">
<Setter Property="Foreground" Value="Red"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Window.Resources>
, 어떤 도움을 주시면 감사하겠습니다!
Path={StaticResource otherColumnName}
당신이이 일이 있는지 여부를 확인하기 위해 resultTable의 재산 "otherColumnName"를 비교하려고 있습니까 :
,하지만 난 변수로 "otherColumnName"를 사용하는 것을 시도하고있다, 나는 리소스로 추가하는 것은 허용 것이라고 생각 그에 대한 – Elliot