【发布时间】:2022-01-15 06:54:14
【问题描述】:
我有一个 UWP DataGrid 并希望在 C# 中为在 CellEditEnded 事件中编辑的选定行和单元格设置单元格样式。到目前为止,我只能为 DataGrid 中的每一行设置列样式。
Style style = new Style();
style.TargetType = typeof(DataGridCell);
style.Setters.Add(new Setter(DataGridCell.BackgroundProperty, new SolidColorBrush(Windows.UI.Colors.Red)));
e.Column.CellStyle = style;
【问题讨论】:
标签: uwp