John, you can use Dynamic Annotation API to set automation ids (msdn.microsoft.com/.../dd318060.aspx).
Check also Michael Bernstein's blog post "Using Dynamic Annotation with Child IDs" (blogs.msdn.com/.../using-dynamic-annotation-with-child-ids.aspx).