DevExpress-Examples / asp-net-web-forms-grid-cascading-comboboxes-for-each-row

Create cascading combo boxes for each row of the ASPxGridView control.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Grid View for ASP.NET Web Forms - How to implement cascading combo boxes in grid

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);
}

Files to Review

Documentation

Online Demos

More Examples

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)

About

Create cascading combo boxes for each row of the ASPxGridView control.

License:Other


Languages

Language:ASP.NET 69.7%Language:Visual Basic .NET 15.5%Language:C# 14.8%