Hello Robert Warthen,
You can achieve this using the TemplateNeeded server event. It's thrown for every node separately and in the handler you can assign the proper template to it, judging by your custom criteria.
The problem you currently experience is caused by the fact that you template the nodes only once and as they are recreated on each and every round-trip to the server, they should be templated on each and every recreation.
Otherwise you are on the right direction, implementing the templates in the code-behind, implementing the ITemplate contract - this is the right way to be done!
One point about that though:
- When you assign template in the handler of TemplateNeeded, please directly add the template to the Node.NodeTemplate property, instead using the InstanciateIn method of your template.
Hope this is helpful for you!
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Telerik Public Issue Tracking
system and vote to affect the priority of the items