Last post Sep 29, 2012 10:50 AM by jasoncmcg
Sep 27, 2012 04:32 PM|jasoncmcg|LINK
I have a custom control that I put together with the approach presented here (with a manual writer.write on the render method): http://msdn.microsoft.com/en-us/library/aa479016.aspx
Now, when I connect a ListView to my ObjectDataSource control and 'configure' it to generate the starter templates, I would like to have it generate the templates with my new custom control instead of the labels and textboxes.
Is there a good tutorial on how to override this funcationality? Does it work the same way with the FormView?
My best guess that this point is that I need to do something with the ITemplate: http://msdn.microsoft.com/en-us/library/system.web.ui.itemplate.aspx
Sep 28, 2012 09:35 AM|jasoncmcg|LINK
In this article, it looks like I could possibly use the CreateControlHierarchy:
However, this one leads me to believe that the CreateChildControls is the right way to go:
Or, do I need to work with IBindableTemplate:
Sep 28, 2012 08:39 PM|Decker Dong - MSFT|LINK
To re-write a control or re-write part of that (I mean to implement ITemplate interface) are different kinds of ways as far as I see. So please don't mex them with each other. You can follow either of them and follow the samples.
Sep 29, 2012 10:50 AM|jasoncmcg|LINK
Alright, this is down a different path than I was originally thinking, but maybe this would align with what you would suggest. I found a tutorial on how to programmatically define the templates.
So, I was thinking that I could define the templates, which I am working on now. Then, if I can figure out how to override the ListView and tell it to load the templates on loading/initializing/databinding/somewhere/... then I could create a custom ListView
like that for each of my business objects. If I can get that working, it would fit well with my needs.