This is a migrated thread and some comments may be shown as answers.

Radgrid Batch Edit Validation

1 Answer 79 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Emrah
Top achievements
Rank 1
Emrah asked on 23 Sep 2014, 03:45 PM
Hello,


I've been trying to implement the validation for batch edit and I can not get  it to work for some reason. I tried the following demo on my local machine and it is not firing the validation. Can you let me know if I need to set something on web.config or what could be possibly reason that it is not firing the validation? 

http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/batch-editing/defaultcs.aspx

Thanks

Here is my code

<telerik:RadGrid ID="RadGrid1" AllowAutomaticInserts="True" AllowAutomaticUpdates="true"   runat="server" OnBatchEditCommand="RadGrid1_BatchEditCommand" AutoGenerateColumns="false" OnNeedDataSource="RadGrid1_NeedDataSource">
    <MasterTableView EditMode="Batch" CommandItemDisplay="TopAndBottom" DataKeyNames="MaterialID" HorizontalAlign="NotSet"  AutoGenerateColumns="false">
        <BatchEditingSettings OpenEditingEvent="Click" EditType="Row" />

         <Columns>
              <telerik:GridTemplateColumn HeaderText="Rental" DataField="IsMaterialRental" UniqueName="IsMaterialRental">
                
                  <ItemTemplate>  <%# Eval("IsMaterialRental") %> </ItemTemplate>
                  <EditItemTemplate>
             <telerik:RadComboBox ID="DeckMaterial_RadComboBoxRental"  runat="server" AllowCustomText="true" MarkFirstMatch="true" >
<Items>
<telerik:RadComboBoxItem Text="No" Value="0" />
<telerik:RadComboBoxItem Text="Yes" Value="1" />
</Items>
</telerik:RadComboBox>                      
         <asp:RequiredFieldValidator ID="DeckMaterial_RequiredFieldValidatorRental" runat="server" Text=""   ControlToValidate="DeckMaterial_RadComboBoxRental"  ></asp:RequiredFieldValidator>                                                          
                  </EditItemTemplate>
              </telerik:GridTemplateColumn>

              <telerik:GridTemplateColumn HeaderText="High Value" DataField="HighValueID" UniqueName="HighValueName">
                  <ItemTemplate>  <%# Eval("HighValue") %> </ItemTemplate>
                  <EditItemTemplate>
                        <telerik:RadComboBox   ID="DeckMaterial_RadComboBoxHighValue"  runat="server" AllowCustomText="true" MarkFirstMatch="true">                             
                        </telerik:RadComboBox>
                  </EditItemTemplate>
              </telerik:GridTemplateColumn>


               <telerik:GridTemplateColumn HeaderText="Quantity" DataField="Quantity" UniqueName="Quantity">                   
                   <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Eval("Quantity") %>'></asp:Label> </ItemTemplate>
                   <EditItemTemplate>
     <telerik:RadNumericTextBox ID="DeckMaterial_RadTextBoxQty" runat="server">
<NumberFormat GroupSeparator="" DecimalDigits="0" />
     </telerik:RadNumericTextBox>
                        
                       <asp:RequiredFieldValidator ID="RequiredFieldValidator_Qty" runat="server" ControlToValidate="DeckMaterial_RadTextBoxQty"   Display="Dynamic" ErrorMessage="Required"></asp:RequiredFieldValidator>

                   </EditItemTemplate>
               </telerik:GridTemplateColumn>

             <telerik:GridBoundColumn DataField="Description" HeaderText="Description" UniqueName="Description" >

                        <ColumnValidationSettings EnableRequiredFieldValidation="true">
                            <RequiredFieldValidator ForeColor="Red" Text="*This field is required" Display="Dynamic">
                            </RequiredFieldValidator>
                        </ColumnValidationSettings>
             </telerik:GridBoundColumn>

             <telerik:GridTemplateColumn HeaderText="Category" HeaderStyle-Width="180px" UniqueName="CategoryID" DataField="CategoryID">
                        <ItemTemplate>
                            <%# Eval("Category") %>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <telerik:RadComboBox ID="RadComboBox_Category" runat="server"></telerik:RadComboBox>
                        </EditItemTemplate>
             </telerik:GridTemplateColumn>

         </Columns>
        
    </MasterTableView>
    <ClientSettings    AllowKeyboardNavigation="true">
    </ClientSettings>
</telerik:RadGrid>

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 24 Sep 2014, 11:52 AM
Hi Emrah,

Could you please refer to the answer in the support ticket that you have opened regarding the same issue (Ticket ID: 862523).

If you have any further questions I could suggest that we continue our conversation in the support ticket.


Best Regards,
Konstantin Dikov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Emrah
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or