protected void ListView_Category_ItemDataBound(object sender, ListViewItemEventArgs e)
{
ListViewDataItem dataItem = (ListViewDataItem)e.Item;
if (ListView_Category.EditItem != null)
{
if (dataItem.DisplayIndex == ListView_Category.EditIndex)
{
//Find datalist control in edititemtemplate of listview.
DataList dl_Product = (DataList)e.Item.FindControl("dl_Product");
foreach (DataListItem item in dl_Product.Items)
{
CheckBox chk_Product = (CheckBox)item.FindControl("chk_Product");
chk_Product.Checked = true;
}
//Or find label control in edititemtemplate of listview.
Label lbl_ProductName = (Label)e.Item.FindControl("lbl_ProductName");
lbl_ProductName.Text = "Assign Text";
}
}
}