Hellooooo... I want to ask a question!
I have Listview1 and in the SelectedItemTemplate I have ListView2. When i click "Select" The Listview2 shows up... and then when i click it again i want it to hide but, i want it check to check if the ListView2 has items to hide the InsertItemTemplate and if it does not have items to show it... I cannot count the items of the 2nd Listview...
I am using this for ListView1 and it works great:
protected void ListView1_DataBound(object sender, EventArgs e)
{
if (ListView1.Items.Count == 0)
{
ListView1.InsertItemPosition = InsertItemPosition.LastItem;
}
else
{
ListView1.InsertItemPosition = InsertItemPosition.None;
}
}
protected void ListView1_SelectedIndexChanging(object sender, ListViewSelectEventArgs e)
{
if (ListView1.SelectedIndex == e.NewSelectedIndex)
{
e.Cancel = true;
ListView1.SelectedIndex = -1;
}
}
I created ListView2_DataBound event but it does not work.. How can i use that in Listview2? i tried to use FindControl but this only works if i put my ListView2 both in the ItemTempate and in the SelectedItemTemplate..