Wednesday, August 19, 2009

aspxcallbackpanel and combobox in DevXpress controls

protected void Page_Load(object sender, EventArgs e) {
if(!IsCallback)
FillCombo(!IsPostBack);
}

protected void FillCombo(bool initSelectedIndex)
{
ASPxComboBox2.Items.Clear();
for(int i = 0; i < 3; i++) {
ASPxComboBox2.Items.Add(ASPxComboBox1.Value.ToString() + i.ToString());
}
if(initSelectedIndex)
ASPxComboBox2.SelectedIndex = 0;
}

protected void ASPxCallbackPanel1_Callback(object source, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) {
FillCombo(true);
}

1 comment: