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

Column Validation Not working in Batch Edit Grid

4 Answers 68 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Rahul
Top achievements
Rank 1
Rahul asked on 29 Jul 2015, 02:03 PM

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?

4 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 31 Jul 2015, 12:48 PM
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
0
Rahul
Top achievements
Rank 1
answered on 31 Jul 2015, 04:54 PM

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)

0
Angel Petrov
Telerik team
answered on 05 Aug 2015, 05:47 AM
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
0
Rahul
Top achievements
Rank 1
answered on 05 Aug 2015, 09:36 AM

Hello,

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

 

Tags
General Discussions
Asked by
Rahul
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Rahul
Top achievements
Rank 1
Angel Petrov
Telerik team
Share this question
or