I'm trying to access the controls within a NoRecordsTemplate block in my code behind. Doing a search in these forums shows the following code snippet:
However, when I try this, the GetItems method returns no items. My GridView control has definitely got NoRecordsTemplate section.
Any ideas why it can't find this?
Thanks for your help,
Dan
protected void RadGrid1_PreRender(object sender, EventArgs e)
{
GridNoRecordsItem norecordItem = (GridNoRecordsItem)RadGrid1.MasterTableView.GetItems(GridItemType.NoRecordsItem)[0];
Label lbl = (Label)norecordItem.FindControl("Label1");
}
However, when I try this, the GetItems method returns no items. My GridView control has definitely got NoRecordsTemplate section.
Any ideas why it can't find this?
Thanks for your help,
Dan