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

access a no-record template

1 Answer 10 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Allen
Top achievements
Rank 1
Allen asked on 08 Oct 2013, 12:44 PM
 
     Hi,
          How can I access a no-record template from server side? Please share if anybody has an idea.

     thanks
     Allen

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 08 Oct 2013, 12:53 PM
Hi Allen,

Please try the sample code snippet to access the NoRecordsTemplate.

ASPX:
<NoRecordsTemplate>
 <asp:Label ID="Label1" runat="server" Text=""></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 = "Empty";
      }
  }

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