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

RadAjaxManager/Object/ObjectEventHandler

4 Answers 60 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Antony
Top achievements
Rank 1
Antony asked on 10 Sep 2019, 08:17 AM

I have 2 objects:

Checkbox1
ComboBox1

When the checkbox1 is checked Combobox1 becomes visible="true" and enabled.
I've used the AJAXManager UpdatedControls and this is working perfectly but the issue is that when im trying to use an eventhandler for example "OnIndexChanged" of Combobox1 it never gets fired.

Below is my sample code:

AjaxManager
 

<telerik:RadAjaxManager runat="server" ID="RadAjaxManager"
       DefaultLoadingPanelID="RadAjaxLoadingPanel1">
       <AjaxSettings>
 <telerik:AjaxSetting AjaxControlID="ComboCompanies">
               <UpdatedControls>
               </UpdatedControls>
           </telerik:AjaxSetting>
           <telerik:AjaxSetting AjaxControlID="chkCompany">
               <UpdatedControls>
                   <telerik:AjaxUpdatedControl ControlID="ComboCompanies" />
               </UpdatedControls>
           </telerik:AjaxSetting>
       </AjaxSettings>
   </telerik:RadAjaxManager>

 

    

4 Answers, 1 is accepted

Sort by
0
Antony
Top achievements
Rank 1
answered on 10 Sep 2019, 08:19 AM

My ComboBox:

<telerik:RadComboBox ID="ComboCompanies" Runat="server"  Enabled="False" Visible="false"                 EnableAutomaticLoadOnDemand="True" ItemsPerRequest="10" AutoPostBack="True"                 EmptyMessage="Select a Company" DataSourceID="SqlGetComapnies" 
                DataTextField="COMPANY_NAME" EnableVirtualScrolling="True" OnClientDropDownOpening="DropDownResetText"                 ShowMoreResultsBox="True"  DataValueField="ID" Width="300px" 
                onselectedindexchanged="ComboCompanies_SelectedIndexChanged"></telerik:RadComboBox>

This is my code that never gets executed:

protected void ComboCompanies_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
     {
       //I HAVE A BREAKPOINT HERE JUST TO CHECK IF IT ENTERS
     }

 

0
Eyup
Telerik team
answered on 13 Sep 2019, 07:01 AM
Hello Antony,

You can resolve this issue by adding the Combo as updated controls of the Combo initiator:
<telerik:AjaxSetting AjaxControlID="ComboCompanies">
     <UpdatedControls>
        // add combo setting here
     </UpdatedControls>
 </telerik:AjaxSetting>

That should do the trick.

Regards,
Eyup
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Antony
Top achievements
Rank 1
answered on 16 Sep 2019, 06:25 AM
Still not firing..

<
telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
      <AjaxSettings>
          <telerik:AjaxSetting AjaxControlID="combo1">
              <UpdatedControls>
                  <telerik:AjaxUpdatedControl ControlID="combo1" UpdatePanelCssClass="" />
              </UpdatedControls>
          </telerik:AjaxSetting>
          <telerik:AjaxSetting AjaxControlID="chkbox1">
              <UpdatedControls>
                  <telerik:AjaxUpdatedControl ControlID="combo1" />
              </UpdatedControls>
          </telerik:AjaxSetting>
      </AjaxSettings>
  </telerik:RadAjaxManager>
      <telerik:RadComboBox ID="combo1" Runat="server" OnSelectedIndexChanged="combo1_SelectedIndexChanged">
          <Items>
              <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem1" Value="RadComboBoxItem1" />
              <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem2" Value="RadComboBoxItem2" />
          </Items>
      </telerik:RadComboBox>
  <div>
 
      <asp:CheckBox ID="chkbox1" runat="server" />
 
  </div>

 

 

    protected void combo1_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)     {         //BREAKPOINT HERE     

    }

0
Eyup
Telerik team
answered on 18 Sep 2019, 08:33 AM
Hi Antony,

There can be some hidden error which can prevent the proper functionality of the controls. You can temporarily disable AJAX and verify that the application works correctly without AJAX:
https://www.telerik.com/support/kb/aspnet-ajax/ajaxmanager/details/get-more-descriptive-errors-by-disabling-ajax

If there are no errors and the issue still remains, you can open a formal support thread to send us a runnable web site so we can reproduce the issue locally and further debug the project. This will enable us to provide more accurate and precise solutions.

Regards,
Eyup
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Ajax
Asked by
Antony
Top achievements
Rank 1
Answers by
Antony
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or