How to Override Global Style and Apply Custom DataGrid Style in XAML
To use your specified DataGrid style instead of a global one, you can add the style to the DataGrid explicitly by setting the Style property to the name of the style in XAML. For example:
<DataGrid Style='{StaticResource YourDataGridStyle}' .../>
Make sure to replace 'YourDataGridStyle' with the actual name of your style resource. This will override any global style for the DataGrid and apply your custom style.
原文地址: https://www.cveoy.top/t/topic/nADN 著作权归作者所有。请勿转载和采集!