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

ComboBox events disabled after validators fire

11 Answers 100 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
tjans
Top achievements
Rank 1
tjans asked on 24 Jul 2008, 01:04 PM
I have a rather large form with textboxes and dropdowns, each with their own validator.  Based on several conditions, including the click of certain radiobuttons in this same form, validators are turned on or off and text boxes are hidden or displayed.  All of this is happening inside of a RadAjaxPanel. 

I'm seeing a very frustrating issue where click one of the radio buttons to enable the validator for a few comboboxes and then click the save button to cause validation, the comboboxes stop responding to events.

To try and isolate the problem, I have even included a combobox with no validator outside of the AjaxPanel to see if it would kill this as well, and it does.

It does not look disabled (greyed out), so I attempted to catch the "OnClientDropDownOpening" event, and verified that before validation was fired the "OnClientDropDownOpening event fired, and then after causing validation again with the save button, the OnClientDropDownOpening was not being fired.

I also just tested to see if how the validators fire effected this issue, and it does.  If I am on  textbox and I clear the text and tab off of it, it fires the validator for that textbox, but doesn't kill the ComboBox events.  If I cause validation for the whole page (via the save button), then it kills the droppdown events.

Finally, I just removed the RadAjaxPanel from the whole page, and the problem went away.

This is a very large piece of code, so I cannot effectively provide an example for you.  I was hoping Telerik, or perhaps another user might have run into this before. Thanks for your time...    

11 Answers, 1 is accepted

Sort by
0
Rosi
Telerik team
answered on 24 Jul 2008, 04:37 PM
Hello ,

Please find the attached project illustrating that everything works as expected at our side.

Download it and find the differences at your side. Could you tell us how to reproduce the problem using the attached project?

Regards,
Rosi
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
tjans
Top achievements
Rank 1
answered on 24 Jul 2008, 07:26 PM
There aren't really any more details I can give than what I've described above.  We use the RadAjaxPanel extensively, and haven't run into issues otherwise.  There's something in the firing of the validators that is breaking the ComboBox "open" event.

If I remove the RadAjaxPanel, the ComboBox opens just fine, which is the strangest part to me.  Perhaps there is some conflict between the javascript that's getting rendered from the Panel vs. the ComboBox...
0
Rosi
Telerik team
answered on 25 Jul 2008, 07:41 AM
Hello ,

Did you reproduce the issue with the project which I sent to you? If no could you modify it so the problem to exist in our project and send it back to us to test it locally?

Regards,
Rosi
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
tjans
Top achievements
Rank 1
answered on 30 Jul 2008, 01:38 PM
Since I am seeing this in another set of code as well, and disabling the ajax panel is not an option, I will try to duplicate this in an isolated set of code and post it here.        
0
tjans
Top achievements
Rank 1
answered on 30 Jul 2008, 02:39 PM
I have an isolated example project that you can use to verify the issue I'm seeing.  I don't see a file upload box, how can I attach this zip file to my post?
0
tjans
Top achievements
Rank 1
answered on 30 Jul 2008, 03:00 PM
Here is the aspx page:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ComboBoxValidators._Default" %> 
 
<%@ Register Assembly="Telerik.Web.UI, Version=2008.1.415.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4" 
    Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server">  
    <title>Untitled Page</title> 
</head> 
<body> 
    <form id="form1" runat="server">  
    <div> 
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
        </telerik:RadScriptManager> 
          
        <ol> 
          <li>Click the "Show ComboBox" button.  This will turn the second div containing the combobox visible and the first div to invisible</li> 
          <li>Drop the combobox down, and you'll see it works correctly</li> 
          <li>Click the "Hide ComboBox" button and it will fire the validator (make sure you have the "Select..." item chosen so the validator fires)</li> 
          <li>Try to drop the ComboBox down and you'll see that it no longer drops down</li>   
        </ol> 
          
        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">  
          
        <div id="FirstDiv" runat="server">  
        <asp:Button ID="ShowButton" runat="server" Text="Show ComboBox" OnClick="ShowButton_Click" /> 
        </div> 
          
        <div id="SecondDiv" runat="server" visible="false">  
        <telerik:RadComboBox ID="RadComboBox1" runat="server">  
          <Items> 
           <telerik:RadComboBoxItem Text="Select..." Value="" /> 
           <telerik:RadComboBoxItem Text="Item1" Value="Item1" /> 
           <telerik:RadComboBoxItem Text="Item2" Value="Item2" /> 
           <telerik:RadComboBoxItem Text="Item3" Value="Item3" /> 
         </Items>   
        </telerik:RadComboBox> 
          
        <asp:RequiredFieldValidator ID="Validator1" runat="server" ControlToValidate="RadComboBox1" text="*" InitialValue="Select..." Display="dynamic" /> 
          
        <asp:Button ID="HideButton" runat="server" Text="Hide ComboBox" OnClick="HideButton_Click" /> 
        </div> 
          
        </telerik:RadAjaxPanel> 
    </div> 
    </form> 
</body> 
</html> 
 

Here is the code-behind:
using System;  
using System.Data;  
using System.Configuration;  
using System.Collections;  
using System.Web;  
using System.Web.Security;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
using System.Web.UI.WebControls.WebParts;  
using System.Web.UI.HtmlControls;  
 
namespace ComboBoxValidators  
{  
    public partial class _Default : System.Web.UI.Page  
    {  
        protected void Page_Load(object sender, EventArgs e)  
        {  
 
        }  
 
        protected void ShowButton_Click(object sender, EventArgs e)  
        {  
            SecondDiv.Visible = true;  
            FirstDiv.Visible = false;  
        }  
 
        protected void HideButton_Click(object sender, EventArgs e)  
        {  
            SecondDiv.Visible = false;  
            FirstDiv.Visible = true;  
        }  
    }  
}  
 
0
tjans
Top achievements
Rank 1
answered on 30 Jul 2008, 03:05 PM
I should also mention that even if there is no validator on the ComboBox, other validators firing (e.g., a validator for another textbox field) still break the ComboBox functionality in this scenario.
0
Rosi
Telerik team
answered on 30 Jul 2008, 04:19 PM
Hi ,

I suggest you log in to your account page and open a support ticket from New Support Ticket page.

Then you can attach the project to the support message and send it to us.

Kind regards,
Rosi
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Steve Napurano
Top achievements
Rank 1
answered on 21 Sep 2011, 12:14 AM
Hi has this been resolved? If so can someone tell em how?

I have combo box on a page, NO validators for the combobox. Other controls on page have validators. When user selects a value from the combobox, the validators for the OTHER controls fire. I set autopostback="true" for the combobox and I have causesvalidation on combobox set to false...

I also have a selectedindexchanged event for combo on server side

Strange

note - ALL controls on page are Telerik controls...

Thanks

Steve
0
Dimitar Terziev
Telerik team
answered on 23 Sep 2011, 03:15 PM
Hello Steve,

I've made a sample page with RadComboBox and couple of RadTextBoxes trying to reproduce the experienced issue, but to no avail. I'm using the current official version of the controls.

In case you are using the latest version of the controls and still experiencing such issue, open a support ticket and provide a runnable sample page so we could examine it locally.

All the best,
Dimitar Terziev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Simone
Top achievements
Rank 1
answered on 21 Nov 2011, 05:14 PM
Had a similar issue. My radcomboxes got locked after Page.Validate fired. I solved the problem by using regular asp panel insteal of RadAjaxPanel .
Tags
ComboBox
Asked by
tjans
Top achievements
Rank 1
Answers by
Rosi
Telerik team
tjans
Top achievements
Rank 1
Steve Napurano
Top achievements
Rank 1
Dimitar Terziev
Telerik team
Simone
Top achievements
Rank 1
Share this question
or