Hi,
I am not quite sure about how you implemented your code but I would like to
remind you that FormView's EditItemTemplate and ItemTemplate properties must
be set separately. So, instead of checking the current mode of FormView, you
have to implement 2 different classes which implement ITemplate interface
and assign them to ItemTemplate and EditItemTemplate properties.
Hope this helps.

Signature
All the best,
Coskun SUNALI
MVP ASP/ASP.NET
http://sunali.com
http://www.propeople.dk
>I have a Formview in my application which has code to dynamically create
> templates at runtime. The code is in a custom class which implements
[quoted text clipped - 13 lines]
> the Formview in insert mode is to put them in the header. Has anybody else
> run into this problem? I am obviously missing something.
Rbrt - 07 Feb 2008 14:08 GMT
ARRRGHHH! How could I be so stupid? I was doing as you suggest but in the
code that creates the edit template, I had put
myformview.itemtemplate=new(....) instead of having code that says
myformview.edititemtemplate=new(....).
You have saved me from my own stupidity. Thank you!
> Hi,
>
[quoted text clipped - 23 lines]
> > the Formview in insert mode is to put them in the header. Has anybody else
> > run into this problem? I am obviously missing something.
Coskun SUNALI [MVP] - 07 Feb 2008 14:29 GMT
Hi,
You are welcome. Should you have any problems in advance, please do not
hesitate to keep asking in the newsgroups.

Signature
All the best,
Coskun SUNALI
MVP ASP/ASP.NET
http://sunali.com
http://www.propeople.dk
> ARRRGHHH! How could I be so stupid? I was doing as you suggest but in the
> code that creates the edit template, I had put
[quoted text clipped - 38 lines]
>> > else
>> > run into this problem? I am obviously missing something.