Column Validation Not working in Batch Edit Grid

5 posts, 0 answers
  1. Rahul
    Rahul avatar
    27 posts
    Member since:
    Jul 2015

    Posted 29 Jul 2015 Link to this post

    Hi there,

    I know this may be simple one but I am not able to get it,

    I have Batch edit grid and validation apply on each column but not able to see any validation on column.

    Following is the code for batch grid.

      <telerik:RadGrid ID="AddMeterReadingRadGrid" GridLines="None" runat="server" Width="99.3%" PageSize="10"
                    AllowAutomaticInserts="True"
                    AllowAutomaticDeletes="True"
                    AllowAutomaticUpdates="True"
                    AllowSorting="false"
                    AllowPaging="True"
                    AutoGenerateColumns="False"
                    OnBatchEditCommand="AddMeterReadingRadGrid_BatchEditCommand"
                    OnPreRender="AddMeterReadingRadGrid_PreRender"
                    OnNeedDataSource="AddMeterReadingRadGrid_NeedDataSource" ValidationSettings-EnableValidation="true">
                    <ClientSettings>
                        <ClientEvents OnBatchEditOpened="OnBatchEditOpened" />
                    </ClientSettings>
                    <MasterTableView CommandItemDisplay="TopAndBottom" HorizontalAlign="NotSet" EditMode="Batch" AutoGenerateColumns="False">

                        <BatchEditingSettings EditType="Row" />

                        <Columns>
                            <telerik:GridBoundColumn DataField="AssetNumber" HeaderStyle-Width="15%" HeaderText="Asset Number" UniqueName="AssetNumber" ItemStyle-Width="10%">
                                <ColumnValidationSettings EnableRequiredFieldValidation="true">
                                    <RequiredFieldValidator ID="reqAssetNumber" ForeColor="Red" Text="*Required" ErrorMessage="*This field is required"></RequiredFieldValidator>
                                </ColumnValidationSettings>
                            </telerik:GridBoundColumn>
                            <telerik:GridTemplateColumn HeaderText="Organization" DataField="Organization" HeaderStyle-Width="10%" UniqueName="OrganizationName">
                                <ItemTemplate>
                                    <%#Eval("Organization") %>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <telerik:RadComboBox runat="server" ID="OrganizationRadComboBox" Width="100px">
                                    </telerik:RadComboBox>
                                    <asp:RequiredFieldValidator ControlToValidate="OrganizationRadComboBox" runat="server" ErrorMessage="*Requierd" Display="Static"></asp:RequiredFieldValidator>
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridDateTimeColumn PickerType="DatePicker" HeaderText="Date" HeaderStyle-Width="14%" DataField="TransactionDate" DataFormatString="{0:MM/dd/yyyy}" DataType="System.DateTime">
                                <ColumnValidationSettings EnableRequiredFieldValidation="true">
                                    <RequiredFieldValidator ForeColor="Red" Text="*Required" Display="Static">
                                    </RequiredFieldValidator>
                                </ColumnValidationSettings>
                            </telerik:GridDateTimeColumn>
                            <telerik:GridDateTimeColumn PickerType="TimePicker" HeaderText="Time" HeaderStyle-Width="14%" DataField="TransactionTime" DataType="System.DateTime" DataFormatString="{0:HH:MM}">
                                <ColumnValidationSettings EnableRequiredFieldValidation="true">
                                    <RequiredFieldValidator ForeColor="Red" Text="*Required" Display="Static">
                                    </RequiredFieldValidator>
                                </ColumnValidationSettings>

                            </telerik:GridDateTimeColumn>
                            <telerik:GridNumericColumn HeaderText="Meter Reading" HeaderStyle-Width="10%" UniqueName="MeterReading" DataField="MeterReading">
                                <ColumnValidationSettings EnableRequiredFieldValidation="true">
                                    <RequiredFieldValidator ForeColor="Red" Text="*Required" Display="Static">
                                    </RequiredFieldValidator>
                                </ColumnValidationSettings>
                            </telerik:GridNumericColumn>
                            <telerik:GridTemplateColumn HeaderText="Meter Type" DataField="MeterTypeID" HeaderStyle-Width="9%" UniqueName="MeterTypeName">
                                <ItemTemplate>
                                    <%#Eval("MeterTypeID") %>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <telerik:RadComboBox runat="server" ID="MeterTypeRadComboBox" DataTextField="MeterDesc" DataValueField="MeterTypeID" EnableViewState="true" Width="100px">
                                    </telerik:RadComboBox>
                                    <asp:RequiredFieldValidator ControlToValidate="MeterTypeRadComboBox" runat="server" ErrorMessage="*Requierd" Display="Static"></asp:RequiredFieldValidator>
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderText="Errors/Wornings" HeaderStyle-Width="14%" ItemStyle-ForeColor="Red">
                                <ItemTemplate>
                                    <%#Eval("Error")%>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridButtonColumn HeaderText="Delete" HeaderStyle-Width="4%" ButtonType="ImageButton" CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">
                            </telerik:GridButtonColumn>
                        </Columns>
                    </MasterTableView>
                    <ClientSettings AllowKeyboardNavigation="true"></ClientSettings>
                </telerik:RadGrid>

     

     

    Plz let me know i am doing any thing wrong?

  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 31 Jul 2015 Link to this post

    Hi Jaydip,

    I used the provided code and created a sample project. It seems to be working as expected on my end - validation is fired for the columns.

    You will find the sample attached. Give it a try and see how it works for you. Would you let me know if I am missing something? Please describe what should be changed in order to replicate the issue.


    Regards,
    Viktor Tachev
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Rahul
    Rahul avatar
    27 posts
    Member since:
    Jul 2015

    Posted 31 Jul 2015 in reply to Viktor Tachev Link to this post

    Hi Viktor,
    Thanks for your replay.
    The sample project and my code  almost same still I am facing the same issue.
    Is there any telerik version related issue.

    (My File Version 2014.1.403.45)

  4. Angel Petrov
    Admin
    Angel Petrov avatar
    1006 posts

    Posted 05 Aug 2015 Link to this post

    Hello,

    There were problems with the validation in the older versions but are now resolved. Please upgrade to the latest version of the controls and test the application again.

    Regards,
    Angel Petrov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  5. Rahul
    Rahul avatar
    27 posts
    Member since:
    Jul 2015

    Posted 05 Aug 2015 Link to this post

    Hello,

    Thanks for your replay,I upgraded telerik with latest version and my problem is solved. thanks

     

Back to Top