У меня есть переопределения DataGrid
. Ниже мой код и XAML. Как установить стиль для изменения цвета фона DataGridCell
при выборе ячейки?WPF переопределил datagrid как установить DatagridCell Выбранный стиль
<vw:DataGridExt
Grid.Row="1"
AlternatingRowBackground="LightGray"
ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent},Path=Value,Mode=OneWay, IsAsync=True}"
Background="White"
AutoGenerateColumns="True"
IsReadOnly="True"
CanUserResizeRows="False"
ClipboardCopyMode="IncludeHeader"
CanUserSortColumns="True"
CanUserAddRows="False"
SelectionMode="Extended"/>
public class DataGridExt : DataGrid
{
public DataGridExt()
{
this.AutoGeneratedColumns += new EventHandler(DataGrid_AutoGeneratedColumns);
}
}
Добавить в мой код xaml. vw: DataGridExt> –
Jack