//public static GridCrudCommandsColumnBuilder<T> CrudCommands<T>(this GridColumnFactory<T> factory, FilterRow filterRow = null) where T : class //{ // if (filterRow != null) // filterRow.AddCell(new ButtonFilterCell()); // var templateColumnBuilder = factory.Template(model => { }); // return new GridCrudCommandsColumnBuilder<T>(templateColumnBuilder); //} public static GridBoundColumnBuilder <TModel> Bound <TModel, TValue>(this GridColumnFactory <TModel> factory, Expression <Func <TModel, TValue> > expression, FilterRow filterRow) where TModel : class { GridBoundColumnBuilder <TModel> builder = factory.Bound(expression); filterRow.AddCell(new TextFilterCell(builder.Column.Member)); return(builder); }
public static GridBoundColumnBuilder <TModel> ForeignKey <TModel, TValue>(this GridColumnFactory <TModel> factory, Expression <Func <TModel, TValue> > expression, IEnumerable data, string dataFieldValue, string dataFieldText, FilterRow filterRow) where TModel : class { GridBoundColumnBuilder <TModel> builder = factory.ForeignKey(expression, data, dataFieldValue, dataFieldText); filterRow.AddCell(new DropDownFilterCell(builder.Column.Member, data, dataFieldValue, dataFieldText)); return(builder); }
public static GridButtonsColumnBuilder Buttons <TModel>(this GridColumnFactory <TModel> factory, Action <GridButtonsColumnFactory <TModel> > buttonAction, FilterRow filterRow = null) where TModel : class { if (filterRow != null) { filterRow.AddCell(new ButtonFilterCell()); } GridButtonsColumn <TModel> column = new GridButtonsColumn <TModel>(factory.Container); buttonAction(new GridButtonsColumnFactory <TModel>(column)); factory.Container.Columns.Add(column); return(new GridButtonsColumnBuilder(column)); }