How can we do this?
features.Updating().StartEditTriggers(GridStartEditTriggers.F2)
I'd like to use F2 and Enter I tried chaining them with | but it doesn't work
Hi qnal,
The F2 and Enter triggers should work, however, they may have effect only when grid has focus at the time when the F2/Enter keys are pressed. The focus is controlled by the Selection feature, so, application should enable that as well. To verify if grid has focus, you may press arrow down/up key. If selected row/cell is not changed, then grid/selection does not have focus and F2/Enter will probably fail as well.
Below is example:
$("#grid").igGrid({ features: [{ name: 'Selection' }, { name: "Updating", startEditTriggers: 'f2,enter' }], ...});
Ok,
But it seems from your answer you're saying that I can only define multiple edit triggers from javascript and not inline via Razor markup?
There should be no difference between javascript and Mvc for updating triggers. I tested Razor Mvc sample and it works exactly the same.Below is example for Mvc.
View:@model Sample.Models.ViewModel...
@Html.Infragistics().Grid(Model.Grid)
Model:
public class ViewModel{ public GridModel Grid { get; set; }}
Controller:public ActionResult DefinedColumns(){ ViewModel viewModel = new ViewModel(); viewModel.Grid = GetGridModel(); return View(viewModel);}private GridModel GetGridModel(){ GridModel gridModel = new GridModel(); GridUpdating u1 = new GridUpdating(); u1.StartEditTriggers = GridStartEditTriggers.F2 | GridStartEditTriggers.Enter; u1.EnableDataDirtyException = false; gridModel.Features.Add(u1); GridSelection uS = new GridSelection(); gridModel.Features.Add(uS); ...}