private SlickGridFormatter determineFormatter(IGridDefinition grid, IColumnPolicies policies) { if (grid.DefaultFormatter != null) { return(grid.DefaultFormatter); } if (grid.UsesHtmlConventions) { Property("displaySubject", TemplateWriter.SubjectFor(Accessor, ElementConstants.Display)); return(SlickGridFormatter.Underscore); } return(policies.FormatterFor(Accessor)); }
public void SelectFormatterAndEditor(IGridDefinition grid, IColumnPolicies policies) { if (Editor() == null && grid.AllColumnsAreEditable) { if (grid.UsesHtmlConventions) { Editor(SlickGridEditor.Underscore); Property("editorSubject", TemplateWriter.SubjectFor(Accessor, ElementConstants.Editor)); } else { Editor(policies.EditorFor(Accessor)); } } if (Formatter() == null) { var formatter = determineFormatter(grid, policies); if (formatter != null) { Formatter(formatter); } } }