Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Web Controls (http://www.velocityreviews.com/forums/f63-asp-net-web-controls.html)
-   -   Creating Dynamic FormView Templates (http://www.velocityreviews.com/forums/t778058-creating-dynamic-formview-templates.html)

Stephen Hatfield 05-01-2006 04:46 PM

Creating Dynamic FormView Templates
 
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

Phillip Williams 05-01-2006 07:56 PM

RE: Creating Dynamic FormView Templates
 
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


Stephen Hatfield 05-02-2006 11:05 AM

RE: Creating Dynamic FormView Templates
 
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


Phillip Williams 05-04-2006 03:41 AM

RE: Creating Dynamic FormView Templates
 
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


cynosureabu 10-19-2012 11:10 PM

Update in FormView does not persist data
 
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


All times are GMT. The time now is 07:41 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57