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
110
How to define default values for MVC igGrid
posted

Hello,

I hope this is a simple question, can someone show me how to define default values for an MVC igGrid.  Here's a snippet of my code:

        .Features(feature =>
        {
            feature.Updating().ColumnSettings(cs =>
            {
                cs.ColumnSetting().ColumnKey("ActvtyKey").ReadOnly(true);
                cs.ColumnSetting().ColumnKey("ActvtyNm").Required(true).TextEditorOptions(o => o.ValidatorOptions(vo => vo.MinLength(2).KeepFocus(ValidatorKeepFocus.Never)));
                cs.ColumnSetting().ColumnKey("TrackngMetrcTxt").EditorType(ColumnEditorType.Text).Required(false);
                cs.ColumnSetting().ColumnKey("OngngStatsFlg").EditorType(ColumnEditorType.Combo).Required(false).ComboEditorOptions(co => co.DataSource(ViewBag.StatusText).ValueKey("FlagKey").TextKey("Status").Mode(ComboMode.DropDown));
            })
            .HorizontalMoveOnEnter(true)
            .ExcelNavigationMode(true)
            .EditMode(GridEditMode.Row);
        })

Can you please show how to set a default value for the text and combo editor please.  Thank you.

Parents Reply Children