Hello Ilga,
Thank you for contacting us.
>> Should this work when I use EditFormCellEditor TemplateReplacements?
Yes. Customize the required editor's validation indicator parameters via set of column's PropertiesTextEdit.ValidationSettings (for the ASPxTextBox editor / GridViewDataTextColumn).
If this does not help, please provide us with a sample working project (with the problematic ASPxGridView control only), so that we can examine it on our side. We will try to suggest an appropriate solution for you.
See Also:
Template Replacements
Thanks,
Mike
Thanks for offering you help. Here is a sample I used to test the behaviour. Note that the indicators show up fine, when don't use the editform:
ASPX:
<dx:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False"
ClientIDMode="AutoID" DataSourceID="SqlDataSource1" KeyFieldName="ID"
OnInitNewRow="ASPxGridView1_InitNewRow"
OnRowValidating="ASPxGridView1_RowValidating">
<Columns>
<dx:GridViewCommandColumn ShowInCustomizationForm="True" VisibleIndex="0">
<EditButton Visible="True">
</EditButton>
<NewButton Visible="True">
</NewButton>
</dx:GridViewCommandColumn>
<dx:GridViewDataTextColumn FieldName="ID" ReadOnly="True"
ShowInCustomizationForm="True" VisibleIndex="0">
</dx:GridViewDataTextColumn>
<dx:GridViewDataTextColumn FieldName="Subject" ShowInCustomizationForm="True"
VisibleIndex="2">
</dx:GridViewDataTextColumn>
</Columns>
<Templates>
<EditForm>
<dx:ASPxPageControl ID="ASPxPageControl1" runat="server" ActiveTabIndex="0"
ClientIDMode="AutoID">
<TabPages>
<dx:TabPage>
<ContentCollection>
<dx:ContentControl runat="server" SupportsDisabledAttribute="True">
<table>
<tr>
<td>
<dx:ASPxGridViewTemplateReplacement ID="ASPxGridViewTemplateReplacementType1"
runat="server" ColumnID="ID" ReplacementType="EditFormCellEditor"
Width="100%" />
</td>
</tr>
<tr>
<td>
<dx:ASPxGridViewTemplateReplacement ID="ASPxGridViewTemplateReplacementType3"
runat="server" ColumnID="Subject" ReplacementType="EditFormCellEditor"
Width="100%" />
</td>
</tr>
</table>
</dx:ContentControl>
</ContentCollection>
</dx:TabPage>
</TabPages>
</dx:ASPxPageControl>
<dx:ASPxGridViewTemplateReplacement ID="UpdateButton" runat="server"
ReplacementType="EditFormUpdateButton" />
<dx:ASPxGridViewTemplateReplacement ID="CancelButton" runat="server"
ReplacementType="EditFormCancelButton" />
</EditForm>
</Templates>
</dx:ASPxGridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:Portal %>"
DeleteCommand="DELETE FROM [T_Opportunity] WHERE [ID] = @ID"
InsertCommand="INSERT INTO [T_Opportunity] ([ID], [Subject]) VALUES (@ID, @Subject)"
SelectCommand="SELECT [ID], [Subject] FROM [T_Opportunity]"
UpdateCommand="UPDATE [T_Opportunity] SET [Subject] = @Subject WHERE [ID] = @ID">
<DeleteParameters>
<asp:Parameter Name="ID" Type="Object" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="ID" Type="Object" />
<asp:Parameter Name="Subject" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="Subject" Type="String" />
<asp:Parameter Name="ID" Type="Object" />
</UpdateParameters>
</asp:SqlDataSource>
Code-Behind:
protected void ASPxGridView1_InitNewRow(object sender, DevExpress.Web.Data.ASPxDataInitNewRowEventArgs e)
{
e.NewValues["Type"] = (Decimal)2004;
}
protected void ASPxGridView1_RowValidating(object sender, DevExpress.Web.Data.ASPxDataValidationEventArgs e)
{
string ErrorColumns = "";
string ValidationColumn = "";
ValidationColumn = "Subject";
if (e.NewValues[ValidationColumn] == null)
{
e.Errors.Add(((DevExpress.Web.ASPxGridView.ASPxGridView)sender).Columns[ValidationColumn], "Input required");
ErrorColumns += " Subject,";
}
if (e.HasErrors)
e.RowError = "Some mandatory fields have not been filled:" + ErrorColumns.Substring(0, ErrorColumns.Length - 1);
}
Sorry that I can't send a ZIP file as the entire project is to big for that. If this isn't sufficient for you, I will build a new project but maybe that's not needed.
The database fields are a GUID (ID) and a string(Subject).
Thanks!
Hello Ilga,
Thank you for your code snippet.
We have reproduced the mentioned behavior of EditFormCellEditor template replacement. We can only suggest you modify your approach and use the Template Replacement type "EditFormEditors" or "EditFormContent". In this case it works properly.
We have decided to forward your issue to our developers so that they can review this problem.
Regards,
Jenny
Hello Ilga,
Thank you for your patience. This behavior was detected as a bug and our developers already resolved it. The required fix is included into the next minor and major builds:
v2010 vol 2
v2011 vol 1
v2011 vol 2
P.S. Can we make this report public, so that it will be available to other users, and will be included in the What's New list for the next maintenance update? What do you think about this?
Regards,
Mike
Hello Ilga,
Thank you for your response. I have published this issue report.
If it is necessary, request a Public Fix build using the "Request Fix" button at the top of this page. Then, we will publish an intermediate build, which can be downloaded and installed prior to the official release date.
Regards,
Mike
Is your intention to post an answer to your own question?
- If so, then proceed.
- If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
- If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.
Facebook
Twitter
Google+