MJ, I have the same problem. The only way around it I have found is to manually do the databinding in the CodeBehind, for the FormView_Updating and FormView_Inserting.
On FormView_DataBind, store the old values in ViewState.
Then in FormView_Updating, populate the OldValues from ViewState
Remember, you probably only need to populate the ID for the OldValues. And of course you'll have to do a similar NewValues population for the FormView_Inserting event.
HTH!
David
TabContainer and TAB ControlTabPanel Tabs TabContainer
In my experience, the FormView control does not support having asp.net controls as child controls except for those used to render the form (labels, textboxes, dropdownlists, etc). For instance, you cannot use <asp:Table> for the form layout but have to
use straight html (<table>) instead. I am certain that trying to embed the TabContainer control within a FormView is the victim of the same limitation.
The correct way of resolving this is, as indicated earlier, to place the FormView within the TabContainer instead of the other way around. FYI - you may have multiple FormViews on a single page and they may all refer to the same DataSourceID. This makes
this solution completely viable.
if I interpret the bug tracker on www.codeplex.com correctly, the issue has been resolved as of the last stable build -
therefore, I don't think that this is a system immanent problem.
However, I hadn't had the time to verify the new release yet.
I have this problem as of today, installed latest toolkit (afaik) 2 days ago, so I presume it hasn't been fixed, just deleted from the bug list!
I have a GridView with an EditTemplate, all working fine. I put a TabContainer+TabPanel in the EditTemplate, moved all the databound content to within the TabPanel and databinding no longer works. Explicitly the e.OldValues & e.NewValues are now empty when
the grid_RowUpdating event is hit!
As I understand it, they are saying it is asp.net's fault for the way it does databinding so do not see it as a bug so it will not be fixed. Ajax prepends its naming hierachy to controls name so it's not found any more, but then how come it is able intialise
the control values from the dataset but then not bind on the way back?)
So if you are using databinding then you may want to avoid using this control (or maybe ajax in general?) which all seems a bit confusing to me. Does databinding not work with 'ANY' AJAX container controls then? surely not?
I "workarounded" this problem using a pure javascript tabbed dialog. I havent found the time to create an asp.net user control to encapsulate it but only an extender which requires you place the "panel" divs inside a "container" div and wants the id of the
"container" as a parameter. The extender passes this id to a javascript which do the rest of the job.
What you get in the web page is exactly the same of ajax tabs, but without troubles regarding bindings as everething reduces to "display: none, display: block"!
This is my first post and I don't know how exactly attach an axample, but i spent some hours (above all) to give this tabbed dialog the look and feel of ajax' one and if it could help someone I will be pleased to share!
mjcreamer
Member
154 Points
34 Posts
Two-way data binding using FormView on TabPanel
Feb 08, 2007 08:10 PM|LINK
It seems that when I place a FormView control on a TabPanel control, two-way data binding no longer works.
The initial display of values (from a SqlDataSource) works fine but when the form is UPDATED, the values cannot be found.
It seems to me that the MultiView and View structure had this same problem but was later fixed.
Have others had this problem? Is there a workaround or a fix?
Here's my basic hierarchy:
<asp:FormView ID="FormView1" runat="server" DataSourceID="SqlDataSourceFormview">
<EditItemTemplate>
<ajaxToolkit:TabContainer ID="TabContainer1" runat="server">
<ajaxToolkit:TabPanel runat="server" HeaderText="Owner">
<ContentTemplate>
... content here ...
</ContentTemplate>
</ajaxToolkit:TabPanel>
</ajaxToolkit:TabContainer>
</EditItemTemplate>
</asp:FormView>
<asp:SqlDataSource ID="SqlDataSourceFormview">
</asp:SqlDataSource>
David Laing
Member
2 Points
1 Post
Re: Two-way data binding using FormView on TabPanel
Feb 09, 2007 03:38 PM|LINK
MJ, I have the same problem. The only way around it I have found is to manually do the databinding in the CodeBehind, for the FormView_Updating and FormView_Inserting.
On FormView_DataBind, store the old values in ViewState.
Then in FormView_Updating, populate the OldValues from ViewState
e.g:
e.OldValues["ID"] = OldConsultationPackValues.ID;
e.OldValues["Code"] = OldConsultationPackValues.Code;
And the NewValues by manually looking up the relevant controls from within the TabPanel
eg:
TabContainer ConsultationPackTabContainer = (TabContainer)GeneralFormView.FindControl("ConsultationPackTabContainer");
TabPanel GeneralTabPanel = (TabPanel)ConsultationPackTabContainer.FindControl("GeneralTabPanel");
TextBox CodeTextbox = (TextBox)GeneralTabPanel.FindControl("CodeTextbox");
e.NewValues["Code"] = CodeTextbox.Text;
Remember, you probably only need to populate the ID for the OldValues. And of course you'll have to do a similar NewValues population for the FormView_Inserting event.
HTH!
David
TabContainer and TAB Control TabPanel Tabs TabContainer
zoetosis
Member
265 Points
119 Posts
Re: Two-way data binding using FormView on TabPanel
Feb 15, 2007 11:06 AM|LINK
Not wishing to be picky as I'm no expert in these matters but you say:
"It seems that when I place a FormView control on a TabPanel control, two-way data binding no longer works."
Looking at your code you have the tabpanel inside the formview.
I have the following structure which works fine without any additional code:
<ajaxToolkit:TabContainer ID="TabContainer1" runat="server">
<ajaxToolkit:TabPanel runat="server" HeaderText="Owner">
<ContentTemplate>
<asp:FormView ID="FormView1" runat="server" DataSourceID="SqlDataSourceFormview">
<EditItemTemplate>
... content here ...
</EditItemTemplate>
</asp:FormView>
</ContentTemplate>
</ajaxToolkit:TabPanel>
</ajaxToolkit:TabContainer>
<asp:SqlDataSource ID="SqlDataSourceFormview">
</asp:SqlDataSource>
Markus Geige...
Member
23 Points
13 Posts
Re: Two-way data binding using FormView on TabPanel
Mar 09, 2007 08:42 AM|LINK
rwcoder
Member
2 Points
1 Post
Re: Two-way data binding using FormView on TabPanel
Mar 17, 2007 08:32 AM|LINK
I'm having the same problem, so thanks for the workaround, and even more so for confirming that this isn't just a problem with my code alone.
Has this been submitted as a bug to the ASP.NET AJAX project?
Thanks.
Markus Geige...
Member
23 Points
13 Posts
Re: Two-way data binding using FormView on TabPanel
Mar 21, 2007 05:14 PM|LINK
> Has this been submitted as a bug to the ASP.NET AJAX project?
Yes, see the link to codeplex in my posting above.
Cheers, M.
SonOfPirate
Member
108 Points
45 Posts
Re: Two-way data binding using FormView on TabPanel
Aug 12, 2007 03:39 AM|LINK
In my experience, the FormView control does not support having asp.net controls as child controls except for those used to render the form (labels, textboxes, dropdownlists, etc). For instance, you cannot use <asp:Table> for the form layout but have to use straight html (<table>) instead. I am certain that trying to embed the TabContainer control within a FormView is the victim of the same limitation.
The correct way of resolving this is, as indicated earlier, to place the FormView within the TabContainer instead of the other way around. FYI - you may have multiple FormViews on a single page and they may all refer to the same DataSourceID. This makes this solution completely viable.
Markus Geige...
Member
23 Points
13 Posts
Re: Two-way data binding using FormView on TabPanel
Aug 13, 2007 08:40 AM|LINK
Hi SonOfPirate,
if I interpret the bug tracker on www.codeplex.com correctly, the issue has been resolved as of the last stable build -
therefore, I don't think that this is a system immanent problem.
However, I hadn't had the time to verify the new release yet.
Regards,
Markus
HappyTalk
Member
34 Points
25 Posts
Re: Two-way data binding using FormView on TabPanel
Nov 12, 2007 11:04 AM|LINK
I have this problem as of today, installed latest toolkit (afaik) 2 days ago, so I presume it hasn't been fixed, just deleted from the bug list!
I have a GridView with an EditTemplate, all working fine. I put a TabContainer+TabPanel in the EditTemplate, moved all the databound content to within the TabPanel and databinding no longer works. Explicitly the e.OldValues & e.NewValues are now empty when the grid_RowUpdating event is hit!
As I understand it, they are saying it is asp.net's fault for the way it does databinding so do not see it as a bug so it will not be fixed. Ajax prepends its naming hierachy to controls name so it's not found any more, but then how come it is able intialise the control values from the dataset but then not bind on the way back?)
So if you are using databinding then you may want to avoid using this control (or maybe ajax in general?) which all seems a bit confusing to me. Does databinding not work with 'ANY' AJAX container controls then? surely not?
tab container fails data binding
egosum
Member
8 Points
4 Posts
Re: Two-way data binding using FormView on TabPanel
Feb 21, 2008 09:03 PM|LINK
I "workarounded" this problem using a pure javascript tabbed dialog. I havent found the time to create an asp.net user control to encapsulate it but only an extender which requires you place the "panel" divs inside a "container" div and wants the id of the "container" as a parameter. The extender passes this id to a javascript which do the rest of the job.
What you get in the web page is exactly the same of ajax tabs, but without troubles regarding bindings as everething reduces to "display: none, display: block"!
This is my first post and I don't know how exactly attach an axample, but i spent some hours (above all) to give this tabbed dialog the look and feel of ajax' one and if it could help someone I will be pleased to share!
Ego