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

Radcombobox clearSelection causes validation

4 Answers 134 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Wired_Nerve
Top achievements
Rank 2
Wired_Nerve asked on 29 Apr 2015, 02:12 PM

I have a radcombobox with a set of items in it.

This combobox is in a radwindow.

If the user opens the radwindow i need to make sure the radcomboboxes selection is set to the empty message and does not cause the required validation control to fire.   On the very first opening of the radwindow all is good, it is when they open the radwindow a second time and I do not want their previous selection selected so I want it set to the Empty Message... 

 You can see in this screen shot the required validator fires after using the comboboxes clearselection javascript code

This is not desired...  Any suggestions...????

Radwindow and combobox markup

 

<telerik:RadWindow runat="server" ID="RadWindowDashboardCofiguration" VisibleOnPageLoad="False"
    Title="Panel Name" Skin="Default" Modal="True" Behaviors="Move, Reload" ShowContentDuringLoad="True"
    OnClientClose="OnClientClose">
    <ContentTemplate>
        <asp:UpdatePanel ID="UpdatePanelDashboardConfiguration" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <div style="padding: 0px 15px 0px 15px;">
                    <div style="padding-top: 15px; padding-bottom: 15px;">
                        <div class="EditFormMainTable">
                            <table>
                                <tr>
                                    <td style="width: 100%">
                                        <div class="EditFormTable">
                                            <table>
                                                <tr class="EditFormRequired">
                                                    <td>
                                                        <label>Panel Display:</label>
                                                    </td>
                                                    <td>
                                                        <telerik:RadComboBox ID="RadComboBoxUserControl" runat="server" AutoPostBack="True" OnSelectedIndexChanged="RadComboBoxUserControl_SelectedIndexChanged" EmptyMessage="Please select panel...">
                                                            <Items>
                                                                <telerik:RadComboBoxItem runat="server" Text="Inventory Statistics" />
                                                                <telerik:RadComboBoxItem runat="server" Text="Notifications" />
                                                                <telerik:RadComboBoxItem runat="server" Text="--- GRAPHS ---" Enabled="False" />
                                                                <telerik:RadComboBoxItem runat="server" Text="Audits - Misplaced Tags (Top 5 Sites)" />
                                                                <telerik:RadComboBoxItem runat="server" Text="Audits - Missing Tags (Top 5 Sites)" />
                                                                <telerik:RadComboBoxItem runat="server" Text="Tag Distributions" />
                                                                <telerik:RadComboBoxItem runat="server" Text="Tag Status Over Time" />
                                                                <telerik:RadComboBoxItem runat="server" Text="Tag Statuses (Rooms)" />
                                                            </Items>
                                                        </telerik:RadComboBox>
                                                        <asp:RequiredFieldValidator ID="RequiredFielduserControl" runat="server" ControlToValidate="RadComboBoxUserControl"
                                                            ErrorMessage="<br />Required" Display="Dynamic" SetFocusOnError="True"
                                                            CssClass="Error"><br />Requied</asp:RequiredFieldValidator>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                    </td>
                            </table>
                        </div>
                    </div>
                    <hr />
                    <a target="blank" href="https://msdn.microsoft.com/en-us/library/c0az2h86.aspx">How to add a user control to a place holder</a>
                    <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
                    <div style="text-align: right;">
                        <asp:ImageButton ID="ImageButtonSave" runat="server" ImageUrl="../TIPWebIT/App_Themes/TIPWeb/Images/Save.gif"
                            ToolTip="Save" />
                    </div>
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </ContentTemplate>
</telerik:RadWindow>

 

4 Answers, 1 is accepted

Sort by
0
Wired_Nerve
Top achievements
Rank 2
answered on 29 Apr 2015, 02:17 PM
0
Hristo Valyavicharski
Telerik team
answered on 04 May 2015, 01:37 PM
Hello Warren,

Thank you for contacting Telerik Support.

I would suggest that you try to add custom validator. The required filed validator will try to validate the text of the input element. 

Let me know if this suggestion is working for you.

Regards,
Hristo Valyavicharski
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Wired_Nerve
Top achievements
Rank 2
answered on 04 May 2015, 01:42 PM

I ended up having the javascript side of the code disable the validator and I re-enable it later in the page lifecycle.  Easy enough, your idea would have worked also. 

 

 

THanks

 

0
John
Top achievements
Rank 1
answered on 14 Mar 2016, 02:41 PM

Hello Wired_Nerve,

I was just wondering if you could tell me how you achieved the following please?

"I ended up having the javascript side of the code disable the validator and I re-enable it later in the page lifecycle."

Where exactly do you re-enable the validator? If you could post some of your solution that would be great.

Thanks in advance,

John.

Tags
ComboBox
Asked by
Wired_Nerve
Top achievements
Rank 2
Answers by
Wired_Nerve
Top achievements
Rank 2
Hristo Valyavicharski
Telerik team
John
Top achievements
Rank 1
Share this question
or