Hi I have two WebDataGrid controls on my page, and each one has a required field validator
If I click on required field on an empty row on grid1, and then click a required field on an empty row in grid2 it causes an infinite loop.
It looks like what it is doing is that the grid1 validator fires after the grid2 selection has been made so it tries to pull the focus back to the required field. By pulling the focus off of grid2 it then fires the grid two required field validator.
So the validators fight each other to try to place focus on their respective required fields.
Any idea how to get around this scenario?
Hello,
Thank you for contacting us.
I have created a sample in order to invoke the issue, although I couldn't. Could you please have a look at the sample and let me know what I am missing from your scenario.
It will be highly appreciated if you could make the necessary changes in order to reproduce the issue.
Looking forward for your reply.
I'm not able to run the sample in my environment but I have simplified the code I'm using as much as possible and still have the problem.
Here is the code I am using. So clicking on and off of the required fields causes the loop to start
<ig:WebDataGrid ID="gridPhone" runat="server"
AutoGenerateColumns="False"
EnableAjax="false"
Width="100%"
Height="135px"
DataSourceID="odsPhone" DataKeyFields="Id"
EnableDataViewState="True" >
<Columns>
<ig:BoundDataField DataFieldName="ContactTypeCd" Key="ContactTypeCd" Width="20%">
<Header Text="Type" />
</ig:BoundDataField>
</Columns>
<EditorProviders>
<ig:TextEditorProvider ID="gridPhone_TextProvider1" EditorControl-MaxLength="40">
<EditorControl ID="EditorControl1" MaxLength="40" runat="server" CausesValidation="True"></EditorControl>
</ig:TextEditorProvider>
</EditorProviders>
<Behaviors>
<ig:EditingCore BatchUpdating="true">
<ig:RowAdding>
<ColumnSettings>
<ig:RowAddingColumnSetting ColumnKey="ContactTypeCd" EditorID="gridPhone_DropDownProvider1" ValidatorID="contactInfoTypeValidator" />
</ColumnSettings>
<EditModeActions MouseClick="Single" EnableOnActive="False" />
</ig:RowAdding>
</Behaviors>
</ig:EditingCore>
</ig:WebDataGrid>
<asp:RequiredFieldValidator
ID="contactInfoTypeValidator"
Text="required"
ControlToValidate="gridPhone"
runat="server"
/>
<br />
<ig:WebDataGrid ID="gridSocial" runat="server"
Height="119px"
DataSourceID="odsSocialMedia" DataKeyFields="Id"
<ig:BoundDataField DataFieldName="SocialNetworkCd" Key="SocialNetworkCd" Width="20%">
<ig:TextEditorProvider ID="gridSocial_TextProvider" EditorControl-MaxLength="40">
<EditorControl ID="EditorControl2" MaxLength="40" runat="server" CausesValidation="True"></EditorControl>
<ig:EditingCore>
<ig:RowAddingColumnSetting ColumnKey="SocialNetworkCd" ValidatorID="socialNetworkValidator" EditorID="gridSocial_DropDownProvider" />
ID="socialNetworkValidator"
ControlToValidate="gridSocial"
ErrorMessage="required"