Hi,
I have code as follows but firing InstantiateIn method. What could be the problem? The same code works in Framework 1.1 and 1.0.
(DetailsView control's CurrentMode property is set to EditMode)
Regards,
Coskun.
Code:
public class myTemplate : ITemplate
{
string _fieldName;
public myTemplate ( string FieldName )
{
_fieldName = FieldName;
}
public void InstantiateIn ( Control container )
{
LiteralControl l = new LiteralControl();
l.Text = _fieldName;
container.Controls.Add( l );
}
}
and calling it in an another web page partial class' onload handler as follows:
Code:
TemplateField tef = new TemplateField();
tef.EditItemTemplate = new myTemplate( "abc" );
myDetailsView.Fields.Add( tef );