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

ComboBox AutoPostBack causing RadTextBox to clear

4 Answers 54 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 19 Aug 2010, 07:22 PM
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

4 Answers, 1 is accepted

Sort by
0
Cori
Top achievements
Rank 2
answered on 20 Aug 2010, 04:07 PM
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.
0
Simon
Telerik team
answered on 20 Aug 2010, 06:50 PM
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
0
Jason
Top achievements
Rank 1
answered on 22 Aug 2010, 01:38 AM
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 

0
Simon
Telerik team
answered on 23 Aug 2010, 09:34 AM
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
Tags
ComboBox
Asked by
Jason
Top achievements
Rank 1
Answers by
Cori
Top achievements
Rank 2
Simon
Telerik team
Jason
Top achievements
Rank 1
Share this question
or