Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
25
How to create a CascadingComboBox in MVC cshtml using Razor syntax?
posted

Hi i am trying to bind the child control from parent control but nothing ig happening when i am doing selection change in parent control.

@(Html.Infragistics().Combo(groupControl.ControlName, groupControl.ParentControlList)

.ValueKey("Parent_Id")
.TextKey("Parent_Name")
.DataBind()
.FilteringType(ComboFilteringType.Local)
.RenderMatchItemsCondition(ComboRenderMatchItemsCondition.StartsWith)
.FilteringCondition("startsWith")
.AutoComplete(true)
.Disabled(groupControl.ReadOnly)
.SelectedIndexes(Model.ScreenData == null || Model.ScreenData.Rows.Count == 0 || string.IsNullOrEmpty(DataManager.GetString(Model.ScreenData.Rows[0], groupControl.FieldName)) ? null : groupControl.SelectedParentControlList)
.ValidatorOptions(m => m.OnBlur(true).OnChange(true).OnSubmit(true).FormSubmit(true).KeepFocus(ValidatorKeepFocus.Never).ShowIcon(true).Required(groupControl.Required))
.DropDownWidth(175)
.Width("175")
.Render())

@:</td></tr><tr><td></td><td>

@(Html.Infragistics().Combo("child" + groupControl.ControlName, groupControl.ChildControlList)
.ValueKey("Child_Id")
.TextKey("Child_Name")
.DataBind()
.CascadingSettings(settings => settings.ParentComboID(groupControl.ControlName).ParentComboKey("Parent_Id"))
.FilteringType(ComboFilteringType.Local)
.RenderMatchItemsCondition(ComboRenderMatchItemsCondition.StartsWith)
.FilteringCondition("startsWith")
.AutoComplete(true)
.Disabled(groupControl.ReadOnly)
.SelectedIndexes(Model.ScreenData == null || Model.ScreenData.Rows.Count == 0 || string.IsNullOrEmpty(DataManager.GetString(Model.ScreenData.Rows[0], groupControl.CascadingFieldName)) ? null : groupControl.SelectedChildControlList)
.ValidatorOptions(m => m.OnBlur(true).OnChange(true).OnSubmit(true).FormSubmit(true).KeepFocus(ValidatorKeepFocus.Never).ShowIcon(true).Required(groupControl.Required))
.DropDownWidth(175)
.Width("175")
.Render())

Thanks in Advance.

Parents Reply Children
No Data