This is a migrated thread and some comments may be shown as answers.

grid back color question

1 Answer 18 Views
Grid
This is a migrated thread and some comments may be shown as answers.
rik butcher
Top achievements
Rank 1
rik butcher asked on 08 Jan 2015, 05:25 PM
guys - we have a method in the ItemDataBound that works well. but I have a question. is it possible to exclude one of the columns. and even have that one cell
be it's own color?


switch (inv_gridcolors)
{
case 2: //On shipping truck in yard
foreach (TableCell cell in boundItem.Cells)
{
cell.BackColor = System.Drawing.Color.Magenta;
inTruck = true;
}
break;
case 1: //Invalid; Move pending
foreach (TableCell cell in boundItem.Cells)
{
cell.BackColor = System.Drawing.Color.RoyalBlue; ;
}
break;
}

1 Answer, 1 is accepted

Sort by
0
rik butcher
Top achievements
Rank 1
answered on 09 Jan 2015, 01:21 PM
guys as usual I figured this one out......... I keep the same code as before and just reference the bound item + cell.
works like a charm
thanks
rik

case 2: 
   foreach (TableCell cell in boundItem.Cells)
{
cell.BackColor = System.Drawing.Color.Magenta;
inTruck = true;

if (dateDif >= 0 && dateDif <= 7 && status != "COMPLETE")
{
boundItem["DATEREQ"].BackColor = System.Drawing.Color.Yellow;
}
else if (dateDif >= 8 && dateDif <= 14 && status != "COMPLETE")
{
boundItem["DATEREQ"].BackColor = System.Drawing.Color.Orange;
}
else if (dateDif < 0 && status != "COMPLETE")
{
boundItem["DATEREQ"].BackColor = System.Drawing.Color.Red;
}
}
break;
Tags
Grid
Asked by
rik butcher
Top achievements
Rank 1
Answers by
rik butcher
Top achievements
Rank 1
Share this question
or