Hello
I am using an old version of RadGrid (2008 Q3) but I hope you will still be able to help.
I am trying to access the controls in my NoRecordsTemplate in the code behind but the code I have written is not fired. I am trying to access the template in the ItemCreated event
Here is the template
The label text is not set and the exception isn't thrown demonstrating that this code is not reached
Thanks in advance for any help you can provide
I am using an old version of RadGrid (2008 Q3) but I hope you will still be able to help.
I am trying to access the controls in my NoRecordsTemplate in the code behind but the code I have written is not fired. I am trying to access the template in the ItemCreated event
Protected Sub gridJourneys_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles gridJourneys.ItemCreated If TypeOf e.Item Is GridNoRecordsItem Then Dim norecordItem As GridNoRecordsItem = CType(gridJourneys.MasterTableView.GetItems(GridItemType.NoRecordsItem)(0), GridNoRecordsItem) Dim l As Label = norecordItem.FindControl("lblNoJourneys") l.Text = "hello" Throw New Exception("here") End If End SubHere is the template
<NoRecordsTemplate>There are no journeys on this date. <asp:Label runat="server" ID="lblNoJourneys" /> </NoRecordsTemplate>The label text is not set and the exception isn't thrown demonstrating that this code is not reached
Thanks in advance for any help you can provide