I'm testing out the new EditFormLayout property on a new project. As part of this project, we are editing a list of objects with various properties. When our users edit these records, we want to force them to provide a reason for the change. However, it doesn't make sense semantically to include the change reason in the underlying data object, as it would only apply to the update, not to the actual object that we'd be showing on the gridview.
Here is my current EditFormLayout section.
ASPx<EditFormLayoutProperties ColCount="1" >
<Items>
<dx:GridViewColumnLayoutItem ColumnName="A">
</dx:GridViewColumnLayoutItem>
<dx:GridViewColumnLayoutItem ColumnName="B">
</dx:GridViewColumnLayoutItem>
<dx:GridViewColumnLayoutItem ColumnName="C">
</dx:GridViewColumnLayoutItem>
<dx:GridViewColumnLayoutItem ColumnName="D">
</dx:GridViewColumnLayoutItem>
<dx:GridViewColumnLayoutItem ColumnName="E">
</dx:GridViewColumnLayoutItem>
<dx:GridViewColumnLayoutItem Caption="Change Reason" VerticalAlign="Top">
<Template>
<uc1:MyCustomControls runat="server" id="MyCustomControl" />
</Template>
</dx:GridViewColumnLayoutItem>
<dx:EditModeCommandLayoutItem ShowUpdateButton="True" ShowCancelButton="True" HorizontalAlign="Center">
</dx:EditModeCommandLayoutItem>
</Items>
</EditFormLayoutProperties>
I've tried using two-way binding to try to get the MyCustomControl control to appear in the ASPxDataUpdatingEventArgs event values, but no dice. I got an error that basically translated to the fact that the attempted property doesn't exist in the underlying datasource, which makes sense.
ASPx<dx:GridViewColumnLayoutItem Caption="Change Reason" VerticalAlign="Top">
<Template>
<uc1:MyCustomControls runat="server" id="MyCustomControl" Value='<%# Bind("MyCustomControlId") %>' />
</Template>
</dx:GridViewColumnLayoutItem>
Is there any way to achieve what I'm looking to do? Essentially I'd be building the object that I'm updating from the event args, then passing that and the reason id to my dal layer to update the record and the reason.