Programmatically assigning a color to a row in DataGrid

后端 未结 3 1693
北恋
北恋 2021-02-05 05:47

I need to assign a color to the row I add at runtime to the DataTable. How can this be done?

3条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-05 06:19

    IMPORTANT : be sure to always assign defaults for rows that aren't being colored by a condition - or any other style.

    See my answer to C# Silverlight Datagrid - Row Color Change.

    PS. I am in Silverlight and haven't confirmed this behavior in WPF

提交回复
热议问题