This is still the most frequently asked question that I get via email. The answer is: TemplateDataMode.Please make sure you set this property to the value that corresponds to your scenario.
In the current version there are two possibilities:
In one of the next version I'll add a third option to specify the value at runtime. This may be helpful for mixed scenarios where you want to display nested grids for one table and single row templates for another.
Update: Another reason why you might get an InvalidCastException is when you set TemplateDataMode to Table and try to bind the child dataset in the Page_Load event. Please change that to the DataBind event as shown in the NestedHierarGrid demo on my website.
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.
© Copyright 2008, Denis Bauer