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

RequiredFieldValidator for Radwindow is not working

5 Answers 183 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Pravallika
Top achievements
Rank 1
Pravallika asked on 12 Jun 2014, 12:19 PM
Hai,

I got one problem in my Radwindow i have some fields its wroking properly before inserting RequiredFieldValidator  after inserting RequiredFieldValidator  
when i click on Add button the Radwindow is not opening.In my page When i click on Add and Edit buttons it will open but now its not opening my code is 
<cc1:RadWindow ID="RadWin_AddEdit" runat="server" Modal="true" Width="730" Height="370"
                VisibleOnPageLoad="false" Visible="false"
                Behaviors="Close,Reload" VisibleStatusbar="false">
                <ContentTemplate>
                    <asp:UpdatePanel ID="upnlSaveUpdateGangway" runat="server" UpdateMode="Conditional">
                        <ContentTemplate>
                            <table id="tblAddGangway" width="100%">
                                  <tr>
                            <td>Category: </td>
                            <td>
                                <div style="display: inline-block">
                                    <cc1:RadComboBox ID="cmbCategory" runat="server" EmptyMessage="- Select Category -" OnSelectedIndexChanged="cmbCategory_SelectedIndexChanged"
                                        AutoPostBack="true" Width="150px">
                                    </cc1:RadComboBox>
                                </div>
                                <div style="display: inline-block">
                                    <cc1:RadComboBox ID="cmbSubCategory" runat="server" EmptyMessage="- Select Sub-category -" OnSelectedIndexChanged="cmbSubCategory_SelectedIndexChanged"
                                        AutoPostBack="true" Width="150px">
                                    </cc1:RadComboBox>
                                </div>
                                </tr>
                                 <tr>
                                <div style="display: inline-block">
                                    <td>Item Master: </td>
                                    <td>
                                    <cc1:RadSearchBox  runat="server" ID="cmbItemMaster" OnSearch="cmbItemMaster_Search" Skin="WebBlue" Style="padding-right: 5px; padding-left: 5px; font-family: Calibri;"
                                                Width="85%" AutoPostBack="true" ZIndex="10000000" DropDownSettings-Width="200px" DropDownSettings-Height="200px">
                                            </cc1:RadSearchBox>
                                     <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator3" ControlToValidate="cmbItemMaster"
                                ForeColor="Red" ValidationGroup="SaveUpdate" Display="Dynamic">*</asp:RequiredFieldValidator>
 
                                    </cc1:RadSearchBox>
                                        </td>
                                </div>
                        </tr>
                          
                               <tr>
                                    <td style="height: 31px;">
                                        <asp:Label ID="lblMaterialCode" runat="server" Text="Material Code"></asp:Label>
                                    </td>
                                    <td style="height: 31px" colspan="3">
                                      <cc1:RadComboBox AutoPostBack="true" ID="ddlMaterialCode" OnSelectedIndexChanged="ddlMaterialCode_SelectedIndexChanged"
                                             runat="server" Width="40%" EmptyMessage="- Select Material code -">
                                        </cc1:RadComboBox>
                                        <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator2" ControlToValidate="ddlMaterialCode"
                                ForeColor="Red" ValidationGroup="SaveUpdate" Display="Dynamic">*</asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="height: 31px;">
                                        <asp:Label ID="lblMaterialName" runat="server" Text="Material Name"></asp:Label>
                                       
 
                                    </td>
                                    <td style="height: 31px" colspan="3">
                                   <%--     <asp:TextBox ID="tbMaterialName" runat="server" MaxLength="100" Width="160px"></asp:TextBox>--%>
                                            <asp:Label ID="lblMName" runat="server" ></asp:Label>
                                    </td>
                                </tr>
                                
                                <tr>
                                    <td style="height: 31px;">
                                        <asp:Label ID="lblQtyRequired" runat="server" Text="Qty Required"></asp:Label>
                                    </td>
                                    <td style="height: 31px" colspan="3">
                                        <asp:TextBox ID="tbQtyRequired" runat="server" MaxLength="100" Width="160px"></asp:TextBox>
                                 <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator1" ControlToValidate="tbQtyRequired"
                                ForeColor="Red" ValidationGroup="SaveUpdate" Display="Dynamic">*</asp:RequiredFieldValidator>
                                </tr>
                                <tr>
                                    <td style="height: 31px;">
                                        <asp:Label ID="lblPriority" runat="server" Text="Priority"></asp:Label>
                                    </td>
                                    <td style="height: 31px" class="tdField" colspan="3">
                                        <asp:DropDownList ID="ddlPriority" runat="server" Width="40%">
                                        </asp:DropDownList>
                                      <asp:RequiredFieldValidator runat="server" ID="rfvDuration" ControlToValidate="ddlPriority"
                                ForeColor="Red" ValidationGroup="SaveUpdate" Display="Dynamic">*</asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="height: 31px;">
                                        <asp:Label ID="lblRemarks" runat="server" Text="Remarks"></asp:Label>
                                    </td>
                                    <td style="height: 31px" colspan="3">
                                        <asp:TextBox ID="tbRemarks" runat="server" MaxLength="400" TextMode="MultiLine" Width="160px"></asp:TextBox>
                                    </td>
                                </tr>
                            </table>
                            <table width="100%">
                                <tr>
                                    <td class="tdControl" align="center">
                                        <asp:Button ID="btnSave" runat="server" Width="50px" OnClick="btnSave_Click"
                                            CommandName="Insert" ValidationGroup="SaveUpdate" Text="Save" />  
 
                                        <input id="btnCancel" onclick="CloseChildWindow();" style="width: 50px;" type="button"
                                            value="Cancel" name="Cancel" />
                                        <asp:HiddenField ID="hdnMRDId" runat="server" />
 
                                    </td>
                                </tr>
                            </table>
                        </ContentTemplate>
                    </asp:UpdatePanel>
 
                </ContentTemplate>
            </cc1:RadWindow>

5 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 13 Jun 2014, 07:08 AM
Hi Pravallika,

From your code I have noticed that you are using RequiredFieldValidator for RadSearchBox, Please try to use the CustomValidator which works fine at my end.

ASPX:
...
<telerik:RadSearchBox runat="server" ID="cmbItemMaster" Skin="WebBlue" Style="padding-right: 5px; padding-left: 5px; font-family: Calibri;" Width="85%" DataSourceID="SqlDataSource1" DataTextField="CityName" autopostback="true" zindex="10000000" DropDownSettings-Width="200px" DropDownSettings-Height="200px">
</telerik:RadSearchBox>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT [CityName] FROM [City]"></asp:SqlDataSource>
<asp:CustomValidator ID="CustomValidator1" runat="server" ErrorMessage="*" ValidationGroup="SaveUpdate" ClientValidationFunction="Validate">
</asp:CustomValidator>
 ...

JavaScript:
function Validate() {
            //write the code for validating RadSearchBox
}

Thanks,
Shinu.
0
Asutosh
Top achievements
Rank 1
answered on 17 Jul 2014, 11:09 AM
hi shinu
i am using radwindow in that i have radgrid
now issue is that when i try to scroll my grid using mouse scroller my whole page scroll which is behind from radwindow and also my radwindow also scroll
i want to make my radgrid scroll on mouse scroller when my radwindow is open 
how can i achieve that?
i have attached sample image also for that 
thanks
0
Shinu
Top achievements
Rank 2
answered on 18 Jul 2014, 06:52 AM
Hi Asutosh,

Please have a look into this forum thread which discuss about the same scenario.

Thanks,
Shinu.
0
Asutosh
Top achievements
Rank 1
answered on 19 Jul 2014, 11:48 AM
hi shinu thanks for your reply
now i have another problem
i am using rad grid in rad window
and in that when i bound three column its width wat i want as i attached want image
but when i bound more than three column first time grid with is small as i have attched error image
and if i close rad window and again open it
its work fine
my radgrid code is as below
 <telerik:RadGrid ID="grd_firstchart_aco" runat="server"  ShowStatusBar="true" AutoGenerateColumns="false"
                                    AllowSorting="True" AllowMultiRowSelection="False" AllowPaging="true" PageSize="10" Skin="Silk" OnNeedDataSource="grd_firstchart_aco_NeedDataSource" Width="99.5%" >
                                    <PagerStyle Mode="Slider"></PagerStyle>
                                 
                                    <GroupingSettings CaseSensitive="false" />
                                    <MasterTableView Width="100%" AllowMultiColumnSorting="True">
                                        <Columns>
                                            <telerik:GridBoundColumn SortExpression="ClaimYearMonth" HeaderText="Claim Year/Month" HeaderButtonType="TextButton" EmptyDataText="Not Available"
                                                DataField="ClaimYearMonth">
                                            </telerik:GridBoundColumn>
                                              <telerik:GridBoundColumn SortExpression="Benchmark" HeaderText="BenchMark" HeaderButtonType="TextButton" DataFormatString="{0:C2}" EmptyDataText="Not Available"
                                                DataField="Benchmark">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn SortExpression="AvgMonthlyCost" HeaderText="Average Monthly Cost" HeaderButtonType="TextButton" DataFormatString="{0:C2}" EmptyDataText="Not Available"
                                                DataField="AvgMonthlyCost">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn SortExpression="AvgSavings" HeaderText="Average Savings" HeaderButtonType="TextButton" DataFormatString="{0:C2}" EmptyDataText="Not Available"
                                                DataField="AvgSavings">
                                            </telerik:GridBoundColumn>
                                          

                                        </Columns>
                                    </MasterTableView>
                                </telerik:RadGrid>

 
0
Shinu
Top achievements
Rank 2
answered on 21 Jul 2014, 03:41 AM
Hi Asutosh,

Unfortunately I couldn't replicate the issue at my end. Please have a look into the sample code snippet which works fine at my end. Please provide your full code and attach the image again if it doesn't help.

ASPX:
<telerik:RadButton ID="rbtnOpenWindow" runat="server" Text="Open Window" AutoPostBack="false">
</telerik:RadButton>
<telerik:RadWindow ID="rwindowOrderGrid" runat="server" OpenerElementID="rbtnOpenWindow">
    <ContentTemplate>
        <telerik:RadGrid ID="grd_firstchart_aco" runat="server" ShowStatusBar="true" AutoGenerateColumns="false" AllowSorting="True" AllowMultiRowSelection="False" AllowPaging="true" PageSize="10" Skin="Silk" Width="99.5%" DataSourceID="sqldsOrders">
            <PagerStyle Mode="Slider"></PagerStyle>
            <GroupingSettings CaseSensitive="false" />
            <MasterTableView Width="100%" AllowMultiColumnSorting="True">
                <Columns>
                    <telerik:GridBoundColumn SortExpression="ClaimYearMonth" HeaderText="Claim Year/Month" HeaderButtonType="TextButton" EmptyDataText="Not Available" DataField="OrderID">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="Benchmark" HeaderText="BenchMark" HeaderButtonType="TextButton" DataFormatString="{0:C2}" EmptyDataText="Not Available" DataField="CustomerID">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="AvgMonthlyCost" HeaderText="Average Monthly Cost" HeaderButtonType="TextButton" DataFormatString="{0:C2}" EmptyDataText="Not Available" DataField="EmployeeID">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="AvgSavings" HeaderText="Average Savings" HeaderButtonType="TextButton" DataFormatString="{0:C2}" EmptyDataText="Not Available" DataField="OrderDate">
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
    </ContentTemplate>
</telerik:RadWindow>
<asp:SqlDataSource ID="sqldsOrders" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT [OrderID], [CustomerID], [EmployeeID], [OrderDate] FROM [Orders]">
</asp:SqlDataSource>

Thanks,
Shinu.
Tags
DropDownList
Asked by
Pravallika
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Asutosh
Top achievements
Rank 1
Share this question
or