Hi Telerik Team,
I'm trying to format the cells of my pivot table and I've seen this link but what I want to do is get the dataitem bound to the cell and test the condition of other members in the dataitem to determine which template to return.
So instead of this
01.
var cellAggregate = item
as
CellAggregateValue;
02.
03.
if
(cellAggregate !=
null
)
04.
{
05.
var description = cellAggregate.Description
as
PropertyAggregateDescription;
06.
07.
if
(cellAggregate.RowGroup.Type == GroupType.BottomLevel && cellAggregate.ColumnGroup.Type == GroupType.BottomLevel)
08.
{
09.
if
(Convert.ToDouble(cellAggregate.Value) > 1000d)
10.
{
11.
return
this
.GreenTemplate;
12.
}
13.
else
14.
{
15.
return
this
.RedTemplate;
16.
}
17.
}
18.
}
I'd like to try and achieve this
01.
var items = item
as
WS_BSQ.View_TestHistory;
02.
03.
if
(items !=
null
)
04.
{
05.
if
(items.Passed ==
null
)
06.
{
07.
return
base
.SelectTemplate(item, container);
08.
}
09.
if
(Convert.ToBoolean(items.Passed) ==
true
)
10.
{
11.
return
this
.GreenTemplate;
12.
}
13.
else
14.
{
15.
return
this
.RedTemplate;
16.
}
17.
}
18.
19.
return
base
.SelectTemplate(item, container);
but I can't seem to find how to expose the item it's bound to in the CellAggregateVaue, or is there another way to go about this?
Cheers,