The issue is that DataGrid is nested within a DataList.
Therefore when you try to hook the event up (In InitializeComponent())
using
this.instancesGrid.ItemCommand += new
DataGridCommandEventHandler(InstancesGrid_ItemComm and);
you'll get a "Object reference not set to an instance of an object."
error. That's because the grid doesn't exist yet. Therefore, I've
tried to wait to hook up the event until the parent DataList
ItemDataBound event.
In the ItemDataBound event I had this code:
((DataGrid)e.Item.FindControl("instancesGrid")).It emCommand += new
DataGridCommandEventHandler(InstancesGrid_ItemComm and);
Although that won't cause an error to be raised, it will not call the
method I'm trying to call (InstancesGrid_ItemCommand). It does call
some event because I can see the page postback, but I'm not sure what
event that is.
Thanks for your help.
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!