當DataGrid屬於單元格選中時出現紅框,是由於WPF中DataGrid擁有默認的驗證屬性,如需關閉,請在DataGrid中加入如下屬性:spa
Validation.ErrorTemplate="{x:Null}"