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

Access controls in norecordtemplate

1 Answer 75 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Savyo
Top achievements
Rank 1
Savyo asked on 20 Nov 2012, 11:26 AM
Hi,
     I want to access controls placed in norecordtemplate from code behind. Can anybody help me do this. thanks
Savyo

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 20 Nov 2012, 11:38 AM
Hi ,

Please take a look into the following code snippet.

ASPX:
<NoRecordsTemplate>
    <asp:Label ID="Label1" runat="server" Text="No records"></asp:Label>
</NoRecordsTemplate>

C#:
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
    if (e.Item is GridNoRecordsItem)
    {
        GridNoRecordsItem item = (GridNoRecordsItem)e.Item;
        Label Label1 = (Label)item.FindControl("Label1");
        Label1.Text = "true";
    }
}

Thanks,
Shinu.
Tags
Grid
Asked by
Savyo
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or