Hi
I have a RadGrid Control which displays a child grid when the Parent Grid Row is clicked.
This works without issues.
In order to make it clearer to the user, I wish to change the background colour of one of the Cells in the row. This is dependant upon the value contained within another column. (Basically some rows will have more than 1 detail row - so I want to indicate this to the user)
When I add this functionality to the ItemDataBound event of the grid, it throws a "PageRequestManagerServerErrorException Object reference not set to an instance of an object." error. when I try to expand the child row. The colour change is is showing correctly.
I have tried adding this to the ItemCreated event but it still throws the error.
Can someone throw some light as to what is causing the error - I believe it is something to do with the Ajax process but cannot pinpoint it exactly.
I am at a loss as to how to trobleshoot this.
Regards
Roger
I have a RadGrid Control which displays a child grid when the Parent Grid Row is clicked.
This works without issues.
In order to make it clearer to the user, I wish to change the background colour of one of the Cells in the row. This is dependant upon the value contained within another column. (Basically some rows will have more than 1 detail row - so I want to indicate this to the user)
When I add this functionality to the ItemDataBound event of the grid, it throws a "PageRequestManagerServerErrorException Object reference not set to an instance of an object." error. when I try to expand the child row. The colour change is is showing correctly.
if
(e.Item
is
GridDataItem)
{
if
(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex][
"DocTypes"
].ToString() ==
"Multiple"
)
{
// Find Column and change colours
GridDataItem item = (GridDataItem)e.Item;
item[
"DocReferences"
].BackColor = Color.Tomato;
item[
"DocReferences"
].ForeColor = Color.White;
}
}
I have tried adding this to the ItemCreated event but it still throws the error.
Can someone throw some light as to what is causing the error - I believe it is something to do with the Ajax process but cannot pinpoint it exactly.
I am at a loss as to how to trobleshoot this.
Regards
Roger