Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 425
  • Last Modified:

Editing an item in a nested datalist

Hi,
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.
0
nikron2626
Asked:
nikron2626
  • 2
1 Solution
 
nikron2626Author Commented:
It works, but I don't understand it.
0
 
aspmaestroCommented:
the child datalist or any child control inside the datalist has to be referred to using the findcontrol method.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now