Current filter:
                                You should refresh the page.
                                  • Hi,

                                    I have created an ASPxGridView with Settings Mode PopupEditForm , with Template EditForm with some fields that's not visible in grid.
                                    The default button "Update" only updates the visible fields in grid, but not the others fields.

                                    C#

                                    [C#]
                                    <Columns> <dx:GridViewDataColumn FieldName="ID" VisibleIndex="1" Visible="false" /> <dx:GridViewDataColumn FieldName="Name" VisibleIndex="2" /> <dx:GridViewDataColumn FieldName="Desc" VisibleIndex="3" /> </Columns> <Templates> <EditForm> <dx:ASPxFormLayout runat="server" ID="projectForm" ColCount="3" Width="100%"> <Items> <dx:LayoutItem FieldName="Name" ColSpan="3"> <LayoutItemNestedControlCollection> <dx:LayoutItemNestedControlContainer> <dx:ASPxTextBox runat="server" ID="tbxName" class="projectEditValues" Text='<%# Eval("Name") %>' Width="250" /> </dx:LayoutItemNestedControlContainer> </LayoutItemNestedControlCollection> </dx:LayoutItem> <dx:LayoutItem FieldName="Desc"> <LayoutItemNestedControlCollection> <dx:LayoutItemNestedControlContainer> <dx:ASPxTextBox runat="server" ID="tbxDesc" class="projectEditValues" Text='<%# Eval("Desc") %>' Width="250" /> </dx:LayoutItemNestedControlContainer> </LayoutItemNestedControlCollection> </dx:LayoutItem> <dx:LayoutItem FieldName="Responsible"> <LayoutItemNestedControlCollection> <dx:LayoutItemNestedControlContainer> <dx:ASPxTextBox runat="server" ID="tbxResponsible" class="projectEditValues" Text='<%# Eval("Responsible") %>' Width="250" /> </dx:LayoutItemNestedControlContainer> </LayoutItemNestedControlCollection> </dx:LayoutItem> <dx:LayoutItem FieldName="Date"> <LayoutItemNestedControlCollection> <dx:LayoutItemNestedControlContainer> <dx:ASPxTextBox runat="server" ID="tbxDate" class="projectEditValues" Text='<%# Eval("Date") %>' Width="250" /> </dx:LayoutItemNestedControlContainer> </LayoutItemNestedControlCollection> </dx:LayoutItem> </Items> </dx:ASPxFormLayout> <div style="text-align: right; padding: 2px"> <dx:ASPxGridViewTemplateReplacement ID="UpdateButton" ReplacementType="EditFormUpdateButton" runat="server"> </dx:ASPxGridViewTemplateReplacement> <dx:ASPxGridViewTemplateReplacement ID="CancelButton" ReplacementType="EditFormCancelButton" runat="server"> </dx:ASPxGridViewTemplateReplacement> </div> </EditForm> </Template>

                                    CS

                                    [C#]
                                    protected void grid_RowUpdating(object sender, ASPxDataUpdatingEventArgs e) { GetProjectUpdated(); } protected Projects GetProjectUpdated() { ASPxFormLayout pageControl = grid.FindEditFormLayoutItemTemplateControl("projectForm") as ASPxFormLayout; ASPxTextBox text = pageControl.FindControl("tbxEmpresa") as ASPxTextBox; }

                                    The pageControl var return with NULL value.

                                • Lanette (DevExpress Support) 01.14.2020

                                  Hello,

                                  I checked your code snippet but currently the issue is not fully clear. Am I correct that you have a problem with saving values of the fields which editors are not shown in the edit form or you have a difficulty with obtaining custom editors values in the RowUpdating event handler? Please describe the issue and your requirements in greater detail. This will help us provide you with the most suitable solution.

                                • Customer89356 01.15.2020

                                  Hello Lanete,

                                  The issue is that the variable pageControl is returning NULL and then I cannot update the fields in Database.

                                  [C#]
                                  ASPxFormLayout pageControl = grid.FindEditFormLayoutItemTemplateControl("projectForm") as ASPxFormLayout;

                                  Maybe I'm doing something wrong.

                                1 Solution

                                Creation Date Importance Sort by

                                Hello,

                                This issue occurs because you are trying to get an instance of the ASPxFormLayout control using the ASPxGridView.FindEditFormLayoutItemTemplateControl method.
                                To solve the issue, you need to use the ASPxGridView.FindEditFormTemplateControl method instead of the ASPxGridView.FindEditFormLayoutItemTemplateControl method.
                                I attached a simple project and video illustrating this approach.
                                Please let me know if this helps.