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
4315
Using cascading combo controls, as igGrid editors, in a MVC solution
posted

When trying to configure an igGrid to have parent and child cascading combo controls as editors, in a MVC solution, changing the parent value doesn't change the values in the child combo. This is the code:

Code Snippet
  1. @(Html.Infragistics().Grid(Model.AsQueryable()).ID("grid1").AutoCommit(true)
  2.     .PrimaryKey("ProductId")
  3.     .Features(features => {
  4.         features.Updating().EditMode(GridEditMode.RowEditTemplate).ColumnSettings(cs => {
  5.             cs.ColumnSetting().ColumnKey("CategoryName").EditorType(ColumnEditorType.Combo)
  6.                 .EditorOptions("id: 'comboCategory',  dataSource: '/Home/GetData', textKey: 'CategoryName', valueKey: 'CategoryName'");
  7.             cs.ColumnSetting().ColumnKey("ProductName").EditorType(ColumnEditorType.Combo)
  8.                 .EditorOptions("id: 'comboCity', dataSource: '/Home/GetData2', parentCombo: 'comboCategory', parentComboKey: 'CategoryName', textKey: 'ProductName', valueKey: 'ProductName'");
  9.         });
  10.     }).DataBind().Render() )
Parents
  • 4315
    Verified Answer
    Offline posted

    This was a bug in the igCombo and it is fixed, and will be available in the upcoming service release for 12.2, 13.1 and for release of the 13.2 Ignite UI version. Then using the code above will work. As alternative, you also can use the code below, which utilize the ComboEditorOptions method instead of EditorOptions one, and is a more clear way to define cascading combo controls in grid. It will be available again in the upcoming service release, which will be out at the end of the month.

    Code Snippet
    1. @(Html.Infragistics().Grid(Model.AsQueryable()).ID("grid1").AutoCommit(true)
    2.     .PrimaryKey("ProductId")
    3.     .Features(features => {
    4.         features.Updating().EditMode(GridEditMode.RowEditTemplate).ColumnSettings(cs => {
    5.             cs.ColumnSetting().ColumnKey("CategoryName").EditorType(ColumnEditorType.Combo)
    6.                 .ComboEditorOptions(ces => {
    7.                     ces.ID("comboCategory").DataSource("/Home/GetData").TextKey("CategoryName").ValueKey("CategoryName").AllowCustomValue(false);
    8.                 });
    9.             cs.ColumnSetting().ColumnKey("ProductName").EditorType(ColumnEditorType.Combo)
    10.                 .ComboEditorOptions(ces => {
    11.                     ces.ID("comboCity").ParentCombo("#comboCategory").ParentComboKey("CategoryName").DataSource("/Home/GetData2").TextKey("ProductName").ValueKey("ProductName").AllowCustomValue(false);
    12.                 });
    13.         });
    14.     }).DataBind().Render() )

    Best regards,
    Nikolay Alipiev

Reply Children
No Data