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

how to make it focus and clear the section after postback?

2 Answers 91 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Henry
Top achievements
Rank 1
Henry asked on 14 Oct 2012, 06:18 PM
I have a combobox(cbProductItems) on the page with:
OnSelectedIndexChanged="cbProductItems_SelectedIndexChanged"

right now after the postback, the combobox shows the item that is selected. I want to clear the selection and also make this combox focused so I can start typing. 

Is this something that I can do it in method cbProductItems_SelectedIndexChanged? I tried follow codes but doesn't seem to work
cbProductItems.ClearSelection();
cbProductItems.DataBind();

Thanks.

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 15 Oct 2012, 05:23 AM
Hi Henry,

Try the following code to achieve your scenario.

C#:
protected void RadComboBox1_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
{
  RadComboBox1.Text = null;
}

Thanks,
Princy.
0
Henry
Top achievements
Rank 1
answered on 15 Oct 2012, 03:50 PM
worked, thanks!
Tags
ComboBox
Asked by
Henry
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Henry
Top achievements
Rank 1
Share this question
or