Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: Setting the EditItemIndex of a Nested Datalist


Message #1 by "Dean Santillan" <webmaster@5...> on Tue, 27 Aug 2002 22:01:59 +0900
Hi,

I am having trouble trying to get the edittemplate
to show of a datalist control that is embedded in a another
datalists ItemTemplate.

Does anyone know how to get this?

public void EditItem(object source,
System.Web.UI.WebControls.DataListCommandEventArgs e)
		{
			DataList NewDL = (DataList)this.DataList1.FindControl("DataList2");

			NewDL.EditItemIndex = e.Item.ItemIndex;
			this.ListNavigation(Int32.Parse(this.DropDownList1.SelectedItem.Value));
		}

I keep getting this error.

Object reference not set to an instance of an object.  which points to this
line
NewDL.EditItemIndex = e.Item.ItemIndex;

Any help or suggestions would greatly appreciated

Thanks
Dean

  Return to Index