![]() |
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 |
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 |
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 |
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 |
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.