Accessing controls in the edititemtemplate of a listview

前端 未结 6 1943
半阙折子戏
半阙折子戏 2021-01-06 10:38

I am working with the listview control. By default I am showing the itemtemplate with an edit button. When the edit button is pressed the listview switches to the edititemte

6条回答
  •  粉色の甜心
    2021-01-06 11:31

    I usually use the ItemDataBound Event... check the other options in ListItemType Enum

        protected void UnitLV_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.EditItem)
            {
                    ListBox myListBox = (ListBox) e.Item.FindControl("ListBox3");
            }
        }
    

提交回复
热议问题