I have a problem with the ASPxGridView and two-way data-binding when controls are put within e.g. a ASPxRoundPanel container.
Is this a bug? How can I make this work / circumvent this problem/limitation?
<Templates>
<EditForm>
<!-- Binding works for SomeField1 -->
Some field1:
<dxe:ASPxTextBox ID="txtSomeField1" runat="server" Width="170px" Text='<%# Bind("SomeField1")%>'>
</dxe:ASPxTextBox>
<!-- Binding doesn't work for SomeField2 contained within a ASPxRoundPanel -->
<dx:ASPxRoundPanel ID="ASPxRoundPanelDbsWeb" runat="server" Width="680px">
<PanelCollection>
<dx:PanelContent runat="server" SupportsDisabledAttribute="True">
Some field2:
<dxe:ASPxTextBox ID="txtSomeField2" runat="server" Width="170px" Text='<%# Bind("SomeField2")%>'>
</dxe:ASPxTextBox>
</dx:PanelContent>
</PanelCollection>
</dx:ASPxRoundPanel>
</EditForm>
</Templates>
Regards,
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Hello Tor,
Thank you for sending the markup to me. If the EditForm's editor is placed within a container control, implementing the INamingContainer interface (if it creates a new namespace, where it is guaranteed that all child control ID attributes are unique within an entire application), it's recommended to use the following approach to get the value of the EditForm's editor:
<Templates> <EditForm> <dx:ASPxRoundPanel ID="ASPxRoundPanel1" runat="server" Width="200px"> <PanelCollection> <dx:PanelContent ID="PanelContent1" runat="server"> <dx:ASPxTextBox ID="ASPxTextBox2" runat="server" Width="170px" Value='<%#Bind("Description")%>'> </dx:ASPxTextBox> </dx:PanelContent> </PanelCollection> </dx:ASPxRoundPanel> ... </EditForm> </Templates>
protected void ASPxGridView1_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { ASPxGridView grid = (ASPxGridView)sender; ASPxRoundPanel panel = (ASPxRoundPanel)grid.FindEditFormTemplateControl("ASPxRoundPanel1"); ASPxTextBox txt = (ASPxTextBox)panel.FindControl("ASPxTextBox2"); e.NewValues["Description"] = txt.Value; }
I've attached a test project, illustrating how you can implement the required functionality.
Thanks,
Mike
--------------------
Check if Search Engine is able to answer questions faster than I do!
--------------------