I have a grid with two columns that contain boolean data types. When trying to edit the grid the allowable values are "true" and "false". Our client would like to see "Yes" and "No" respectively. Is there a template I can override to display different text instead of the default?
Thanks,
Display 'Yes' instead of 'true' for Boolean values igGrid combo using javascript
Here was my solution:
Razor:
feature.Updating() .ColumnSettings(setting => { setting.ColumnSetting().ColumnKey("Id").Required(true).EditorType(ColumnEditorType.Combo).ComboEditorOptions(option => { option.AllowCustomValue(false).DataSource(Model.NewComboValues).EnableClearButton(false).TextKey("Key").ValueKey("Value").ValueKeyType(ComboDataType.Bool); }); });Model:
public KeyValuePair<string, string>[] NewComboValues{ get { return new KeyValuePair<string, string>[] { new KeyValuePair<string, string>("Yes", Boolean.TrueString), new KeyValuePair<string, string>("No", Boolean.FalseString) }; }}
Everything works perfectly!