Editing an item in a nested datalist
Posted on 2005-03-02
I have a datalist control with another datalist embedded in the item template. I successfully bind and show all the appropriate records and the 'child' records. The problem occurs when I click an edit button or the cancel button when in the edit item template. When the user clicks the edit button in the child datalist it must change the edititemindex and rebind. If I use the databind command it falls over giving me a 'Object variable with block not set' error. The strange thing is if I take out the databind method and simply set the index it will work the SECOND time I click the edit button. Then when it is in the edit mode and I click the cancel button the exact same thing happens. I take out the databind method and have to click the cancel button twice to get it to reset the child data list.