i have datagrid(see bellow) there is columns with date time how i can make background red where rooomNumer is 777 from 1/8/2011 to 5/8/2011 with code behind? Room number column bind with observable collection
ObservableCollection<RoomsInfoData> _RoomsInfoCollection = new ObservableCollection<RoomsInfoData>();
public RoomsInfo()
public ObservableCollection<RoomsInfoData> RoomsInfoCollection
{
get { return _RoomsInfoCollection; }
}
public class RoomsInfoData
{
public string RoomType { get; set; }
public string RoomNumber { get; set; }
public string RoomStatus { get; set; }
}
HProDataContext db = new HProDataContext();
var _RoomNumber = (from d in db.SelectRooms select d.roomnumber).ToList();
var _RoomType = (from d in db.SelectRooms select d.roomtype).ToList();
var _RoomStatus = (from d in db.SelectRooms select d.status).ToList();
for (int i = 0; i < _RoomNumber.Count; i++)
{
_RoomsInfoCollection.Add(new RoomsInfoData { RoomNumber = _RoomNumber[i], RoomType = _RoomType[i], RoomStatus = _RoomStatus[i] });
}

Assuming that
We will specify a style in the Window / UserControl’s Resources collection … like this
in code behind after you set all columns to this.dataGrid … do this…
Let me know if this helps.