how do I find a PlaceHolder in a DetailItemTemplate
I have added OnItemDataBound="RadGrid1_ItemDataBound" to RadGrid1
I have tried many different variations.
i was able to do the following:
I have added OnItemDataBound="RadGrid1_ItemDataBound" to RadGrid1
I have tried many different variations.
protected
void
RadGrid1_ItemDataBound(
object
sender, GridItemEventArgs e)
{
Label lbl =
new
Label();
lbl.Text =
"Proofs:"
;
lbl.CssClass =
"cLabel"
;
if
(e.Item
is
GridDataItem)
{
GridDataItem item = (GridDataItem)e.Item;
PlaceHolder PlaceHolderProof = (PlaceHolder)item[
"PlaceHolderProof"
].Controls[0];
//PlaceHolder PlaceHolderProof = (PlaceHolder)item.FindControl("PlaceHolderProof");
PlaceHolderProof.Controls.Add(lbl);
}
}
i was able to do the following:
GridDataItem item = e.Item
as
GridDataItem;
if
(item !=
null
)
{
RadButton ProofButton = item.DetailTemplateItemDataCell.FindControl(
"ProofButton"
)
as
RadButton;
string
ID = item[
"Approved"
].Text;
if
(ID ==
"0"
)
{
ProofButton.Visible =
false
;
}
else
{
ProofButton.Visible =
true
;
}
}