Rank: Newbie Groups: Member
Joined: 1/14/2010 Posts: 3
|
I've successfully created an ImageZoom control in code. However, I can't figure out how to add the ZoomPanelTemplate. If I was adding the control in the aspx file it would look like this:
<ZoomPanelTemplate> <div> {var:big_image} </div> </ZoomPanelTemplate>
How do I do that programmatically? There is a ZoomPanelTemplate field, but I can't figure out how to add the div and var to it:
ImageZoom theImage = new ImageZoom(); ... ... theImage.ZoomPanelTemplate ????
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
ZoomPanelTemplate is an ITemplate. So you will need to create a class that implement ITemplate, then create an instance of that class and assign the instance to ZoomPanelTemplate. If you are not familiar with that, you can Google "add template column" online and you should find plenty of articles explaining how to dynamically add a template DataGrid/GridView column programmatically. It's the same as that. This is not anything particular to our controls.
Thanks!
|