RadComboBox Disabled After Postback

10 posts, 0 answers
  1. Adam
    Adam avatar
    7 posts
    Member since:
    May 2012

    Posted 16 Oct 2012 Link to this post

    I have tried searching for this problem, so if this is a re-post please link to the original.

    I have two RadComboBoxes inside a RadAjaxPanel (the latter is actually in a MasterPage), along with a regular ASP.NET Button control. When I click the button, I go through some simple validation to see if the user selected an item in each RadComboBox. If not, I make a <div> element visible with an error message, and exit the subroutine.

    This works fine. However, after the button click and error message is displayed, the RadComboBox controls are disabled. They don't look grayed out, but clicking the drop down arrow does nothing, and mousing over the controls doesn't produce the normal "highlight" effect that shows when controls are active.

    Regular ASP.NET DropDownLists do not produce this behavior. I'd really like to use the RadComboBox because I want the checkbox feature of it, but if I can't get this figured out in a couple hours I'll have to switch to ListBox controls.

    Any idea what's wrong here?

    Thank you,

    Adam
  2. Adam
    Adam avatar
    7 posts
    Member since:
    May 2012

    Posted 16 Oct 2012 Link to this post

    I also just tried using RadListBox controls instead, and after clicking the button the controls reset their height to the default (I had it set at 200px) and became "read-only", the same type of thing that happened with the RadComboBox controls.

    Looks like it's the default ASP.NET controls for now, but I would really like to know what's going on here.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 17 Oct 2012 Link to this post

    Hi Adam,

    Could you provide us a snippet of code, with the implementation that you use at your end? In addition, could you confirm what is the exact version of the controls that you use?


    Regards,
    Nencho
    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.
  5. Matthew
    Matthew avatar
    51 posts
    Member since:
    Oct 2012

    Posted 28 Mar 2013 Link to this post

    I'm experiencing the same issue, and here is the code I currently have:

    <%--<telerik:RadAjaxLoadingPanel ID="ralpWhite" runat="server" BackColor="White" Transparency="50" Width="110%" />--%>
    <telerik:RadAjaxPanel runat="server" LoadingPanelID="ralpWhite" RenderMode="Inline" RestoreOriginalRenderDelegate="true">
        <div class="formSection">
            <h2 class="internshipHeading">Agency Info</h2>
            <asp:Table ID="tAgency" runat="server" CssClass="infoTable">
                <asp:TableRow>
                    <asp:TableCell CssClass="label">International:</asp:TableCell>
                    <asp:TableCell>
                        <asp:CheckBox ID="cbInternational" runat="server" AutoPostBack="true" CausesValidation="false" Checked='<%# Bind("AFormIsInternational") %>' OnCheckedChanged="cbInternational_CheckedChanged" />
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow>
                    <asp:TableCell CssClass="label">Agency:</asp:TableCell>
                    <asp:TableCell>
                        <telerik:RadComboBox runat="server" ID="rcbAgency" AutoPostBack="true" AppendDataBoundItems="true" CausesValidation="false" EmptyMessage="Select an agency"
                                                        DataSourceID="ldsAgencies" DataTextField="AgencyName" DataValueField="AgencyID" OnSelectedIndexChanged="rcbAgency_SelectedIndexChanged">
                            <Items>
                                <telerik:RadComboBoxItem Text="New Agency" Value="0" CssClass="rcbiNewAgency" />
                            </Items>
                        </telerik:RadComboBox>
                    </asp:TableCell>
                    <asp:TableCell>
                        <asp:RequiredFieldValidator runat="server" ControlToValidate="rcbAgency" Display="Dynamic" ForeColor="Red" ErrorMessage="Select an agency!" />
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow ID="trAgencyName" runat="server" Visible="false">
                    <asp:TableCell CssClass="label">Agency Name:</asp:TableCell>
                    <asp:TableCell>
                        <telerik:RadTextBox runat="server" ID="txtAgencyName" MaxLength="100" Width="400px" />
                    </asp:TableCell>
                    <asp:TableCell>
                        <asp:RequiredFieldValidator runat="server" ControlToValidate="txtAgencyName" Display="Dynamic" ForeColor="Red" ErrorMessage="Enter an agency name!" />
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow ID="trAgencyWebsite" runat="server" Visible="false">
                    <asp:TableCell CssClass="label">Agency Website:</asp:TableCell>
                    <asp:TableCell><telerik:RadTextBox runat="server" ID="txtAgencyWebsite" MaxLength="250" Width="400px" /></asp:TableCell>
                    <asp:TableCell>
                        <asp:RequiredFieldValidator runat="server" ControlToValidate="txtAgencyWebsite" Display="Dynamic" ForeColor="Red" ErrorMessage="Enter a website!" />
                        <asp:RegularExpressionValidator runat="server" ControlToValidate="txtAgencyWebsite" Display="Dynamic" ForeColor="Red" ErrorMessage="Enter a website!" ValidationExpression="^[A-Za-z0-9.-]+\.[A-Za-z]{3}$" />
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow ID="trAgencyAddress" runat="server" Visible="false">
                    <asp:TableCell CssClass="label">Agency Address:</asp:TableCell>
                    <asp:TableCell><telerik:RadTextBox runat="server" ID="txtAgencyAddress" MaxLength="75" /></asp:TableCell>
                    <asp:TableCell><asp:RequiredFieldValidator runat="server" ControlToValidate="txtAgencyAddress" Display="Dynamic" ForeColor="Red" ErrorMessage="Enter a city!" /></asp:TableCell>
                </asp:TableRow>
                <asp:TableRow ID="trAgencyCity" runat="server" Visible="false">
                    <asp:TableCell CssClass="label">Agency City:</asp:TableCell>
                    <asp:TableCell><telerik:RadTextBox runat="server" ID="txtAgencyCity" MaxLength="75" /></asp:TableCell>
                    <asp:TableCell><asp:RequiredFieldValidator runat="server" ControlToValidate="txtAgencyCity" Display="Dynamic" ForeColor="Red" ErrorMessage="Enter a city!" /></asp:TableCell>
                </asp:TableRow>
                <asp:TableRow ID="trAgencyState" runat="server" Visible="false">
                    <asp:TableCell CssClass="label"><asp:Label runat="server" ID="lblState" Text="Agency State:" /><asp:Label runat="server" ID="lblCountry" Text="Agency Country:" Visible="false" /></asp:TableCell>
                    <asp:TableCell><telerik:RadTextBox runat="server" ID="txtAgencyState" MaxLength="75" /></asp:TableCell>
                    <asp:TableCell><asp:RequiredFieldValidator runat="server" ControlToValidate="txtAgencyState" Display="Dynamic" ForeColor="Red" ErrorMessage="Enter a state!" /></asp:TableCell>
                </asp:TableRow>
            </asp:Table>
        </div>
    </telerik:RadAjaxPanel>

    I'd also like to note that I can't get the loading panel to work. It fires once at best.

    Here's the relevant code-behind:

    protected void cbInternational_CheckedChanged(object sender, EventArgs e)
    {
        CheckBox box = sender as CheckBox;
        dvEdit.FindControl("lblState").Visible = !box.Checked;
        dvEdit.FindControl("lblCountry").Visible = box.Checked;
    }
     
    protected void rcbAgency_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
    {
        dvEdit.FindControl("trAgencyName").Visible =
            dvEdit.FindControl("trAgencyWebsite").Visible =
            dvEdit.FindControl("trAgencyAddress").Visible =
            dvEdit.FindControl("trAgencyCity").Visible =
            dvEdit.FindControl("trAgencyState").Visible = e.Text == "New Agency";
    }

    Any help would be appreciated. Thanks.
  6. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 02 Apr 2013 Link to this post

    Hello Matthew,

    Would you elaborate a bit more on your scenario? What exactly is the issue you are currently facing? In addition, under which browser the issue is experienced and which version of our controls are you using?

    Kind regards,
    Nencho
    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.
  7. Matthew
    Matthew avatar
    51 posts
    Member since:
    Oct 2012

    Posted 02 Apr 2013 Link to this post

    I'm using 2012 Q3. The issue is identical in all browsers (IE, Chrome, Firefox). The RadComboBox inside the RadAjaxPanel fires the server-side OnSelectedIndexChanged event in order to check when the New Agency option is selected and display more fields (also within the RadAjaxPanel) for the user to tell us about the new agency. Also inside the RadAjaxPanel is an asp:Checkbox that toggles the visibility of two labels in the RadAjaxPanel server-side. The second postback from either control suddenly turns on the readonly property for all RadComboBoxes on the whole page. The other RadComboBoxes do not have the same effect.
  8. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 05 Apr 2013 Link to this post

    Hello Matthew,

    I am afraid that I was unable to replicate the described issue. Would you provide us with the implementation of the mentioned "all RadComboBoxes on the whole page". Here is a video, demonstrating the behavior at my end. In addition, if you could submit a support ticket, along with a runnable sample attached demonstrating the faced issue, it would be greatly appreciated.

    All the best,
    Nencho
    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.
  9. Matthew
    Matthew avatar
    51 posts
    Member since:
    Oct 2012

    Posted 30 Apr 2013 Link to this post

    Sorry for the delay. I worked on other parts of our application and when I came back to this the issue had resolved itself. Thanks.
  10. Kenneth
    Kenneth avatar
    11 posts
    Member since:
    Jan 2012

    Posted 25 Jul 2013 Link to this post

    I am having the same problem.  Was there any solution found for this issue?
  11. Kenneth
    Kenneth avatar
    11 posts
    Member since:
    Jan 2012

    Posted 25 Jul 2013 Link to this post

    Nevermind.  I found a user control on the page that I was using to save scroll position that was causing the issue.   I will post up if I figure out exactly what it was doing.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017