Telerik control events always being triggered

1.3k Views Asked by At

I'm using the Telerik combo box to create cascading multi-select drop down lists.

I have several drop down lists on the page ddlProject, ddlUnit, ddlDiscipline, ddlDocType.

I am using the Telerik RadAjaxManager to trigger the updates of the controls and the markup of this is as follows:

<telerik:RadAjaxManager ID="ajaxManager" runat="server" DefaultLoadingPanelID="lpnlLoading" >
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="ddlProject" EventName="TextChanged">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="ddlUnit" UpdatePanelRenderMode="Inline"/>
                    <telerik:AjaxUpdatedControl ControlID="ddlDiscipline" UpdatePanelRenderMode="Inline" />
                    <telerik:AjaxUpdatedControl ControlID="ddlDocType" UpdatePanelRenderMode="Inline" />
                    <telerik:AjaxUpdatedControl ControlID="ddlPhase" UpdatePanelRenderMode="Inline" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="ddlUnit" EventName="TextChanged" >
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="ddlDocType" UpdatePanelRenderMode="Inline"  />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="ddlDiscipline" EventName="TextChanged">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="ddlDocType" UpdatePanelRenderMode="Inline" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

ddlProject updates ddlUnit, ddlDiscipline and ddlDocType.

ddlUnit and ddlDiscipline are only meant to update ddlDocType but I am finding that the TextChanged event is being fired when either of these controls is changed.

I've tried commenting out the Ajax Manager to see if ddlProject_TextChanged is being called and it's not, only when the Ajax Manager is on the page. I would like the Ajax Manager to be enabled to suppress the page postbacks plus it displays a loading panel for each of the comb boxes which I think gives good user experience showing when they are loading.

All this is within a user control because I want to use it on multiple pages.

Can someone please help with a solution to stop ddlProject_TextChanged being fired when unit and discipline are changed?

Thanks in advance

Andy

Edit:

I've just discovered that it might not be the AjaxManager. The control events seem to be getting fired every time the page does a post back. I also have a standard ASP.NET button which on click does not databind to any of the checkboxes, it just processes the selected values in the user control. It's even external to the user control which contains the combo boxes.

Combobox structure:

<telerik:RadComboBox ID="ddlUnit" runat="server" CheckBoxes="true" EnableCheckAllItemsCheckBox="true" 
   MaxHeight="450px" Width="300px" DataTextField="Value" DataValueField="Key" Label="Unit:" 
   LabelCssClass="HeaderLabel" DropDownWidth="600px" Height="400px"
   AutoPostBack="true" OnTextChanged="ddlUnit_TextChanged">
</telerik:RadComboBox>

TextChanged event

protected void ddlDiscipline_TextChanged(object sender, EventArgs e)
        {
            CTRmDataService ctrmDS = new CTRmDataService();

            this.ddlDocType.DataSource = ctrmDS.GetDocumentTypesForProjectsDisciplineAndUnit(GetSelectedProjects(), 
                                                                                             GetSelectedDisciplines(), 
                                                                                             GetSelectedUnits(), 
                                                                                             LoggedOnUser.Id);
            this.ddlDocType.DataBind();
        }
2

There are 2 best solutions below

0
On

Not sure this will help at all but in our instance the issue was down to the IIS server caching content that has an adverse effect on Telerik controls. It only became apparent to us when we switched out web.config settings from debug="true" to debug="false" as this then allowed IIS to enable its caching and other related optimizations, turning all caching off in the browser for some reason still broke the controls, however turning it off in IIS or turning it back onto debug mode solved it.

2
On

I've just been informed by Telerik that this is a bug and has been passed over to their development team.

Not necessarily a working answer but explains why I'm having the problems.