
Sreedath Kuttan
Top achievements
Rank 1
Sreedath Kuttan
asked on 11 Jun 2008, 05:01 AM
Hi,
I am using the RadCombobox.I want to fire an event only on Selected Index change and not on Text change.But the Selected Index change is firing on Text changed.
Is there any way to avoid this behaviour?
I am using the RadCombobox.I want to fire an event only on Selected Index change and not on Text change.But the Selected Index change is firing on Text changed.
Is there any way to avoid this behaviour?
3 Answers, 1 is accepted
0
Hello Sreedath ,
RadComboBox first both of this events, because when the SelectedIndex is changed, the Text of RadComboBox is changed too. However, SelectedIndexChanged event fires before TextChanged.You can use this and do not execute TextChanged event of the SelectedIndexChanged is already fired.
See the following code for an example:
Regards,
Rosi
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
RadComboBox first both of this events, because when the SelectedIndex is changed, the Text of RadComboBox is changed too. However, SelectedIndexChanged event fires before TextChanged.You can use this and do not execute TextChanged event of the SelectedIndexChanged is already fired.
See the following code for an example:
public partial class DefaultCS: XhtmlPage |
{ |
bool isChangedFired = false; |
private void Page_Load(object sender, System.EventArgs e) |
{ |
Label1.Text = String.Empty; |
if(!IsPostBack) |
{ |
RadComboBox1.LoadContentFile("combobox.xml"); |
} |
} |
protected void RadComboBox1_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e) |
{ |
if (RadComboBox1.SelectedItem != null) |
{ |
isChangedFired = true; |
} |
} |
protected void RadComboBox1_TextChanged(object sender, EventArgs e) |
{ |
if (isChangedFired) return; |
} |
} |
Regards,
Rosi
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0

Sreedath Kuttan
Top achievements
Rank 1
answered on 11 Jun 2008, 08:06 AM
Hi thank you for the reply.
But I don't want to fire any event on the Text change even the selected index change.Is there any way to accomplish this?
But I don't want to fire any event on the Text change even the selected index change.Is there any way to accomplish this?
0
Hi Sreedath ,
RadComboBox does not support canceling the TextChanged event of RadComboBox .
It will always fire if the Text of the RadComboBox is changed and you are hook on the TextChanged event.
Regards,
Rosi
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
RadComboBox does not support canceling the TextChanged event of RadComboBox .
It will always fire if the Text of the RadComboBox is changed and you are hook on the TextChanged event.
Regards,
Rosi
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center