Given a ListView with an ItemTemplate, InsertItemTemplate, and EditItemTemplate, how can I access the controls in the EditItemTemplate before they are first displayed?
<telerik:RadListView ID="ContactsList" runat="server" DataSourceID="ContactsDataSource" |
GroupItemCount="4" |
DataKeyNames="EntityContactID" |
OnItemEditing="ContactsList_ItemEditing" |
AllowMultiItemEdit="false" |
> |
ContactsDataSource is a LinqDataSource with EnableUpdate=true
<ItemTemplate> |
<asp:LinkButton ID="LinkButton1" runat="server" Text='<%# DataBinder.Eval( Container, "DataItem.Name" ) %>' |
ForeColor="Blue" CommandName="Edit" CausesValidation="false" /> |
protected void ContactsList_ItemEditing(object sender, RadListViewCommandEventArgs e) |
{ |
if (e.ListViewItem.ItemType == RadListViewItemType.DataItem) |
{ |
RadListViewDataItem dataItem = (RadListViewDataItem)e.ListViewItem; |
Here, dataItem.DataItem is null, e.ListViewItem.FindControl() only finds controls in the ItemTemplate and not the EditItemTemplate and e.ListViewItem.IsInEditMode is false.
There is a LinkButton in the EditItemTemplate I need to access and modify before the edit form is shown to the user.