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

[Solved] Reset Selected Index on Postback

2 Answers 224 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Curt
Top achievements
Rank 1
Curt asked on 20 Mar 2008, 07:04 PM
I realize this may not be specific to the radcombobox but I need to reset the selected value of a combobox after the page postsback.  Normally I would just do a page redirect at this point but the page is in a radwindow so that option is out.

I have tried just about everything I can think of.  The page always reloads with the last selected value.

I have tried disabling viewstate, setting the selectedindex = -1, .ClearSelection().

I want the user to be able to fill out the page, submit the page, and then fill it out again but I need the values to be reset.  I can reset textboxes, checkboxes, and the other controls but not the combobox.

Any ideas?

Thanks

2 Answers, 1 is accepted

Sort by
0
Accepted
Simon
Telerik team
answered on 24 Mar 2008, 01:06 PM
Hi sl6rp,

I tried reproducing the problem but to no avail. Please find attached the test project. Could you point out what am I missing? Could the problem be reproduced by modifying the project?

Thank you in advance.

All the best,
Simon
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Curt
Top achievements
Rank 1
answered on 24 Mar 2008, 05:30 PM

The attached project worked fine.  Slightly different than what I am doing but once I saw 

OnClientLoad

="OnClientLoad"

and 

<

script type="text/javascript">

function OnClientLoad(sender)

{

sender.clearSelection();

}

</script>

I was able to add the same to my project and get the desired outcome.

Thanks

-Brent

Tags
ComboBox
Asked by
Curt
Top achievements
Rank 1
Answers by
Simon
Telerik team
Curt
Top achievements
Rank 1
Share this question
or