Questions tagged [itemplate]
50 questions
7
votes
2 answers
Load template from embedded resource
How can I load an embedded resource as an ITemplate? The LoadTemplate() method only takes a string virtual path, and obviously this will not work for embedded resources.

MadSkunk
- 3,309
- 2
- 32
- 49
7
votes
1 answer
ITemplate and DataGrid Column in Codebehind
I have a situation where I need to work with a datagrid and adding columns dynamically in PageInit as the grid has a few conditional requests that it must handle. I'm moving along easily with BoundColumns, and ButtonColumns, those are easy. The…

Mitchel Sellers
- 62,228
- 14
- 110
- 173
5
votes
1 answer
Is there a better way to access controls in an ITemplate than FindControl()?
When a control is added to an UpdatePanel, it can still be accessed from the code behind of the containing page. How is this achieved? Can custom control developers do the same?
In other words, if I develop a template control using the ITemplate…

James
- 7,877
- 7
- 42
- 57
4
votes
1 answer
ASP.Net ITemplate - ways of declaring
when we want to define a Template in our user controls we declare a field like this in our user controls
public ITemplate MyTemplate { get; set; }
so that the user defined templates contents will be represented in MyTemplate, and you can use…

Mahes
- 3,938
- 1
- 34
- 39
3
votes
2 answers
Replace CheckBoxList TemplateControl with custom UserControl?
I am trying to create a more detailed item template for the standard CheckBoxList control. It exposes an ITemplate property called TemplateControl but I wasn't able to find a straightforward resource on how to actually use it. Here's the code I have…

Kevin
- 13,044
- 11
- 55
- 76
2
votes
2 answers
ASP.Net Dynamic Gridview with custom ItemTemplate
I need some help in rendering a dynamic gridview.
Using the source code below, I can add the grid to the page and it generates one row for each entry in the datasource.
The problem is that the controls only appears in the last row. If I add another…
user662359
2
votes
0 answers
Can't change modes with dynamic FormView templates
I have an ASP.NET page with a FormView data-bound to an ObjectDataSource that uses dynamically generated templates to render the UI based on layout information from the application's database. I've been able to get the templates to render correctly…

SonOfPirate
- 5,642
- 3
- 41
- 97
2
votes
1 answer
Vsixmanifest supporting Visual Studio 2012, 2013, 2015
For a project I'm trying to create a set of development templates that hopefully can work on Visual Studio 2012, 2013 and 2015.
Google helped me a little bit and suggested to read this;
vsixmanifest for all: VS 2010, 2012 and 2013
This implies to me…

jarnohenneman
- 963
- 10
- 21
2
votes
1 answer
asp.net create Gridview item template dynamically with button click
asp.net 4.0 forms.
I need to create a Gridview Dynamically with a button linked to the table ID Key.
So I set up the Gridview and start adding columns:
private void SetupGV()
{
try
{ //0
TemplateField tf = new…

Lambda
- 1,020
- 2
- 10
- 25
2
votes
2 answers
FindControl in Custom ITemplate
I have a custom UserControl which uses a simple ITemplate:

Echilon
- 10,064
- 33
- 131
- 217
1
vote
1 answer
Custom Web Control, ITemplate not recognised
Hopefully an easy one, I have created a Custom Repeater control that extends System.Web.UI.WebControls.Repeater. I Have added two ITemplate Properties to this control and add these when required and in the desired manner. Everything is working…

stibstibstib
- 109
- 7
1
vote
2 answers
Error in Web User Control with ITemplate in the Design mode
I have a web user control with the following markup
<%= this.Title %> |
![]()
Ahmed Magdy
1
vote
1 answer
itemCommand event not firing in ListView with custom ITemplateI have created a custom itemtemplate for my listView control, but the item command does not fire for the buttons generated through the ITemplate. NOt only this, the items disappear when you click on any button. Following is the code i am using, is…
Phillip
1
vote
1 answer
Selecting an Item in GridView with ITemplate Generated ButtonI'm having trouble figuring out how could I use my imagebutton (see below) in my ITemplate to append the button's corresponding row data (ItemID) as a query string.
My ImageButton in my ITemplate:
ImageButton select_button = new…
![]()
Erick Garcia
1
vote
1 answer
How To Add Event Handlers to Controls in a clss inheriting ITemplateI've made a Template for adding controls to a DetailsView I have from code behind.
private class edgFooterTemplate : ITemplate
{
private Button btn_Edit;
public void InstantiateIn(Control container)
{
btn_Edit = new Button();
…
![]()
Erick Garcia
|