Since the Grid is positioned inside the detail template expressions inside the client template inside of the inner Grid will be evaluated by the outer, to avoid this you need to escape the sharp symbols.
Regarding the first question you can use the template
to execute conditional logic and render different buttons based on your data. Check the FAQ
for similar question.
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI