Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Creating Dynamic FormView Templates

Reply
Thread Tools

Creating Dynamic FormView Templates

 
 
Stephen Hatfield
Guest
Posts: n/a
 
      05-01-2006
Is it possible to create FormView templates (EditItemTemplate,
InsertItemTemplate, ItemTemplate) dynamically by calling a separate class
file to generate the template. My attempts at this have been unsuccessful. I
am working in the ContentPlaceHolder on a page using a masterpage. I have
tried adding a PlaceHolder tag and putting the FormView control within but
still no luck. I have seen the example for doing this within a web page but
not by calling the ITemplate class within a different .cs file.

Thank you!
Steve
 
Reply With Quote
 
 
 
 
Phillip Williams
Guest
Posts: n/a
 
      05-01-2006
http://www.webswapp.com/codesamples/...e/default.aspx
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com


"Stephen Hatfield" wrote:

> Is it possible to create FormView templates (EditItemTemplate,
> InsertItemTemplate, ItemTemplate) dynamically by calling a separate class
> file to generate the template. My attempts at this have been unsuccessful. I
> am working in the ContentPlaceHolder on a page using a masterpage. I have
> tried adding a PlaceHolder tag and putting the FormView control within but
> still no luck. I have seen the example for doing this within a web page but
> not by calling the ITemplate class within a different .cs file.
>
> Thank you!
> Steve

 
Reply With Quote
 
 
 
 
Stephen Hatfield
Guest
Posts: n/a
 
      05-02-2006
Thanks for your reply Philip! I have no problem generating templates for
Columns in a GridView. I am having problems doing the same with a FormView.

Steve

"Phillip Williams" wrote:

> http://www.webswapp.com/codesamples/...e/default.aspx
> --
> HTH,
> Phillip Williams
> http://www.societopia.net
> http://www.webswapp.com
>
>
> "Stephen Hatfield" wrote:
>
> > Is it possible to create FormView templates (EditItemTemplate,
> > InsertItemTemplate, ItemTemplate) dynamically by calling a separate class
> > file to generate the template. My attempts at this have been unsuccessful. I
> > am working in the ContentPlaceHolder on a page using a masterpage. I have
> > tried adding a PlaceHolder tag and putting the FormView control within but
> > still no luck. I have seen the example for doing this within a web page but
> > not by calling the ITemplate class within a different .cs file.
> >
> > Thank you!
> > Steve

 
Reply With Quote
 
Phillip Williams
Guest
Posts: n/a
 
      05-04-2006
Hi Stephen,

I just added another demo within the same section on my website for the
FormView.
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com


"Stephen Hatfield" wrote:

> Thanks for your reply Philip! I have no problem generating templates for
> Columns in a GridView. I am having problems doing the same with a FormView.
>
> Steve
>
> "Phillip Williams" wrote:
>
> > http://www.webswapp.com/codesamples/...e/default.aspx
> > --
> > HTH,
> > Phillip Williams
> > http://www.societopia.net
> > http://www.webswapp.com
> >
> >
> > "Stephen Hatfield" wrote:
> >
> > > Is it possible to create FormView templates (EditItemTemplate,
> > > InsertItemTemplate, ItemTemplate) dynamically by calling a separate class
> > > file to generate the template. My attempts at this have been unsuccessful. I
> > > am working in the ContentPlaceHolder on a page using a masterpage. I have
> > > tried adding a PlaceHolder tag and putting the FormView control within but
> > > still no luck. I have seen the example for doing this within a web page but
> > > not by calling the ITemplate class within a different .cs file.
> > >
> > > Thank you!
> > > Steve

 
Reply With Quote
 
cynosureabu cynosureabu is offline
Junior Member
Join Date: Oct 2012
Posts: 1
 
      10-19-2012
Philip,
I was checking the FormView sample on your website, However, the code there does not seem to be complete. e.g, I could not see where DataBound occurs.

My current issue is that
I add the ItemTemplate, and EditItemTemplate during OnInit stage as in your sample.

ItemTemplate has an edit button, then in order to switch to the Edit mode,
I have to do

this.MyFormView.ChangeMode(FormViewMode.Edit);
this.MyFormView.DataBind();

in OnItemCommand, (this part is not shown in your sample either)

However, the timing when DataBind occured in OnItemCommand is already too late. Although formview correctly displayed the edit mode, any updated value cannot be saved. In fact, I even could not receive Update command in OnItemCommand. Does my question makes sense to you?
Thank you in advance for your help!

Chen
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formview within Formview Chris ASP .Net 0 05-19-2007 04:12 PM
Hiding labels and textboxs in formview templates according to role =?Utf-8?B?QW5u?= ASP .Net 0 05-11-2007 11:09 PM
how to Specializations of function Templates or Overloading Function templates with Templates ? recover C++ 2 07-25-2006 02:55 AM
FormView/Repeater/ Eval(FormView data) David Thielen ASP .Net Web Controls 2 06-16-2006 07:56 PM
Templates templates templates JKop C++ 3 07-21-2004 11:44 AM



Advertisments