本文介绍了我正在使用C#WPF和datagirid我需要特定的行颜色变化吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

private void Liste()
{


ID = Convert.ToInt32(MainWindow.UserID);

var data = from p in dc.ToplantiTalepFormus from c in dc.Onays where p.Toplanti_Talep_ID == c.Toplanti_Talep_ID select new { p.Toplanti_Talep_ID, p.Toplanti_Talep_Tarihi, p.Toplanti_Tarihi, p.Toplanti_Saat, p.Toplanti_Konusu, p.Toplanti_Yeri, p.Toplanti_Şekli, p.Toplantı_Durumu, c.Toplantı_Onay, c.Yeni_Tarih, c.Yeni_Saat, c.DeğişiklikOnay, c.User_ID };

foreach (var ToplantiTalepFormus in data)


{
if (ToplantiTalepFormus.User_ID == 1)
{
Datagrid.RowBackground = Brushes.Red;
}
Datagrid.ItemsSource = data.ToList();

}
this is I try to do it but When I do
if (ToplantiTalepFormus.User_ID == 1)
{
Datagrid.RowBackground = Brushes.Red;
}





我的尝试:



这是我尝试做的但当我这样做时

if(ToplantiTalepFormus.User_ID == 1)

{

Datagrid.RowBackground = Brushes.Red;

}



What I have tried:

this is I try to do it but When I do
if (ToplantiTalepFormus.User_ID == 1)
{
Datagrid.RowBackground = Brushes.Red;
}

推荐答案


这篇关于我正在使用C#WPF和datagirid我需要特定的行颜色变化吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 19:30