Radcombobox clearSelection causes validation

5 posts, 0 answers
  1. Wired_Nerve
    Wired_Nerve avatar
    163 posts
    Member since:
    Oct 2007

    Posted 29 Apr 2015 Link to this post

    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>

     

  2. Wired_Nerve
    Wired_Nerve avatar
    163 posts
    Member since:
    Oct 2007

    Posted 29 Apr 2015 in reply to Wired_Nerve Link to this post

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    Posted 04 May 2015 Link to this post

    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.

     
  5. Wired_Nerve
    Wired_Nerve avatar
    163 posts
    Member since:
    Oct 2007

    Posted 04 May 2015 in reply to Hristo Valyavicharski Link to this post

    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

     

  6. John
    John avatar
    31 posts
    Member since:
    May 2014

    Posted 14 Mar in reply to Wired_Nerve Link to this post

    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.

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017