This example demonstrates how to create cascading combo boxes for each row of the ASPxGridView control.
To implement the cascading behavior between a pair of ASPxComboBox controls defined within the same row, editor settings are specified dynamically in the Init
event.
protected void cmbMaster_Init(object sender, EventArgs e) {
ASPxComboBox cmbParent = (ASPxComboBox)sender;
GridViewDataItemTemplateContainer templateContainer = (GridViewDataItemTemplateContainer)cmbParent.NamingContainer;
cmbParent.ClientSideEvents.SelectedIndexChanged = string.Format("function(s, e) {{ OnSelectedIndexChanged(s, e, {0}); }}", templateContainer.VisibleIndex);
}
protected void cmbChild_Init(object sender, EventArgs e) {
ASPxComboBox cmbChild = (ASPxComboBox)sender;
GridViewDataItemTemplateContainer templateContainer = (GridViewDataItemTemplateContainer)cmbChild.NamingContainer;
cmbChild.ClientInstanceName = string.Format("cmbChild_{0}", templateContainer.VisibleIndex);
cmbChild.Callback += new DevExpress.Web.CallbackEventHandlerBase(cmbChild_Callback);
}
- Default.aspx (VB: Default.aspx)
- Default.aspx.cs (VB: Default.aspx.vb)
- Combo Box for ASP.NET Web Forms - How to implement cascading combo boxes
- How to refer to a client-side control encapsulated in a specific instance of UserControl
(you will be redirected to DevExpress.com to submit your response)