ComboBox AutoPostBack causing RadTextBox to clear

5 posts, 0 answers
  1. Jason
    Jason avatar
    17 posts
    Member since:
    Feb 2007

    Posted 19 Aug 2010 Link to this post

    HI,

    I have a small form with a radcombobox and 2 radtextboxes as below:

     

    <asp:Label ID="lblHeaderPrinter" runat="server" Text="" Font-Bold="true" Font-Underline="true"></asp:Label>

     

    <table>

     

     

     

    <tr>

     

     

     

    <td>Manufacturer:</td>

     

     

     

    </tr>

     

     

     

    <tr 

    <td>

     

    <telerik:RadComboBox ID="ddlManufacturer2" AutoPostBack="true" runat="server"

     

     

     

    AppendDataBoundItems="true" Skin="Windows7" OnSelectedIndexChanged="ddlManufacturer2_SelectedIndexChanged">  

    </telerik:RadComboBox>

     

    </td 

    </tr>

     

    </table 

    <table>

     

    <tr 

    <td>Model #:</td>

     

    <td>Price:</td 

    </tr>

     

    <tr 

    <td><telerik:RadTextBox ID="txtPrinterModel" Width="400px" runat="server"></telerik:RadTextBox></td>

     

    <td>$<telerik:RadTextBox ID="txtPrinterPrice" runat="server"></telerik:RadTextBox></td 

    </tr 

     

    </table>

     

    <table><tr><td 

    <asp:Button ID="btnAddPrinter" runat="server" Text="ADD Printer" OnClick="btnAddPrinter_Click" />

     

    <asp:Button ID="btnClearP" runat="server" Text="Clear" OnClick="btnClearP_Click" /></td></tr></table 

    <asp:Label ID="lblPConfirm" runat="server" Text="" Font-Bold="true" ForeColor="Red"></asp:Label>

     

    So, I've noticed that when I click Add Printer, the form data inserts in my database with the exception of the txtPrinterModel text.  Upon further playing around, I discovered that if i have the txtPrinterModel and txtPrinterPrice fields filled in, and then change the selected value of the combobox, the txtPrinterModel field clears out, but the txtPrinterPrice does not.  Why would this be the case?  How can I prevent the autopostback on the comobbox from affecting the txtPrinterModel text box?  I do NOT want to turn the autopost back to false because I'd like to use validator controls, and the ddlManufacturer2_SelectedIndexChanged clears my label out, among other functionality that I'd like to add later.

    As of now, the code for ddlManufacturer2_SelectedIndexChanged looks like this and has no interaction with txtPrinterModel

     

    public

     

     

    void ddlManufacturer2_SelectedIndexChanged(object sender, EventArgs e)

    {

    lblPConfirm.Text =

     

    "";

     

     

    }

     

     


    All of this is on a user control which has a RadAjaxManagerProxy, however, no ajax settings for any of these controls.  The RadAjaxManager on the main page also has no ajax settings at the moment.

    Please help. I've been trying to fix this issue for 2 days!!!!

    Thanks,
    Jason
  2. Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 20 Aug 2010 Link to this post

    Are you somehow clearing the text in the Page_Load event of your UserControl for that textbox and not checking for IsPostback?

    That's all I can think of.
  3. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 20 Aug 2010 Link to this post

    Hi Jason,

    An additional thing you may want to test is whether you can type in the textbox once its text gets cleared. If you cannot then this may be a bug we fixed in the Q2 release. Which version of Telerik.Web.UI are you using in this application?

    Greetings,
    Simon
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  4. Jason
    Jason avatar
    17 posts
    Member since:
    Feb 2007

    Posted 21 Aug 2010 Link to this post

    I'm using 2010 Q1, BUT I CAN type in the box after it is cleared.  It seems like the radcombobox postback is affecting the next control on the page.  If I switch the order of the two boxes below, the txtPrinterPrice box is cleared out.  So it's not the textbox control or any coding that is attached to the textbox. 

     

    <tr 

     

    <td><telerik:RadTextBox ID="txtPrinterModel" Width="400px" runat="server"></telerik:RadTextBox></td>

     

    <td>$<telerik:RadTextBox ID="txtPrinterPrice" runat="server"></telerik:RadTextBox></td 

     

    </tr 

  5. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 23 Aug 2010 Link to this post

    Hello Jason,

    We have not encountered such an issue before and I am not sure at the moment what is causing it.

    Can you please use FireBug (w/ FireFox)/FiddlerCap (w/ IE) to capture the request/response data of the postback which triggers the issue and post here the form fields of the request and the response from the server or attach screenshots showing the same?

    Best wishes,
    Simon
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top