【发布时间】:2020-05-04 09:34:46
【问题描述】:
public class EventLogView : UserControl
{
private DataGrid dataGrid;
public EventLogView()
{
this.InitializeComponent();
dataGrid = this.FindControl<DataGrid>("EventLogsDataGrid");
this.dataGrid.LoadingRow += new EventHandler<DataGridRowEventArgs>(dataGrid_LoadingRows);
}
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
void dataGrid_LoadingRows(object sender, DataGridRowEventArgs e)
{
}
}
如果第 4 列的值为“HIGH”,我想将每一行的颜色更改为红色。
【问题讨论】:
-
在代码隐藏中我可以访问这个特定的 DataGrid 对象,我可以将每一行更改为红色,但我无权访问列的值
标签: c# wpf xaml datagrid avalonia