This question is locked. New answers and comments are not allowed.
hi i have a new problem :)
i am using selecting cells and query them.. find the result, change the back and fore color..
but what i want to do is:
if (today >= startDate) AND (today<=endDate)
change the background to green and foreground to white of each startDate and endDate column
else
change the background to red and foreground to yellow of each startDate and endDate column
how can i do it in a shorter way?
var startDate = ScheduleGrid.ChildrenOfType<GridViewCell>().Where(c => c.Column.UniqueName ==
"startDate"
);
var s1 = startDate.Where(c => (Convert.ToDateTime(c.Value)).Date <= DateTime.Now.Date).ToList();
s1.ForEach(c => c.Background =
new
SolidColorBrush(Colors.Green));
s1.ForEach(c => c.Foreground =
new
SolidColorBrush(Colors.White));
var endDate = ScheduleGrid.ChildrenOfType<GridViewCell>().Where(c => c.Column.UniqueName ==
"endDate"
);
var s2 = endDate.Where(c => (Convert.ToDateTime(c.Value)).Date >= DateTime.Now.Date).ToList();
s2.ForEach(c => c.Background =
new
SolidColorBrush(Colors.Green));
s2.ForEach(c => c.Foreground =
new
SolidColorBrush(Colors.White));
i am using selecting cells and query them.. find the result, change the back and fore color..
but what i want to do is:
if (today >= startDate) AND (today<=endDate)
change the background to green and foreground to white of each startDate and endDate column
else
change the background to red and foreground to yellow of each startDate and endDate column
how can i do it in a shorter way?