<ej:Grid ID="OrdersGrid" runat="server" AllowPaging="true" AllowSelection="true" Selectiontype="Multiple"> <SelectionSettings SelectionMode="cell"/> <Columns> <ej:Column Field="OrderID"/> <ej:Column Field="EmployeeID"/> <ej:Column Field="ShipCity"/> <ej:Column Field="ShipCountry"/> <ej:Column Field="Freight" /> </Columns> </ej:Grid> |
Thanks for provided links. In my
scenario Grid should be in Batch edit mode (by design), so I reckon that
SelectionMode=row fits my scenario better. I changed settings of Left and Right
arrows using Grid’s Create event (found here):
create: function (args) {
args.model.keyConfigs.leftArrow = ""; // Remove the default Functionalities
args.model.keyConfigs.rightArrow = ""; // Remove the default Functionalities
args.model.keyConfigs.moveCellLeft = "shift+9,37"; // Using left arrow to move cell left
args.model.keyConfigs.moveCellRight = "9,39"; // Using right arrow to move cell
right
}
The only issue that I have in this case is each time I try to navigate through cells by Left and Right arrows, an active cell change it state to Edit mode and I can’t continue navigation (Tab/Shift+Tab works) until I press Esc key. Can I set behavior of active Cell to not enter edit mode until I press F2 key?
See attached screenshots.
Below is code for my grid
initialization:
$("#dgMonPoints").ejGrid({
dataSource: data,
editSettings: {
allowEditing: true, allowAdding: false, allowDeleting: false, editMode: ej.Grid.EditMode.Batch,
showConfirmDialog: true
},
allowSelection: true,
selectionType : "single",
selectionSettings: {
selectionMode: ["row"]
},
toolbarSettings: { showToolbar: true, toolbarItems: ["edit", "update", "cancel"] },
columns: [
{ field: "PredatorEntryId", headerText: "Id", isPrimaryKey: true, visible: false },
{ field: "MonitoringPointId", headerText: "Tunnel No", allowEditing: true },
{
field: "RatResult", headerText: "Rat", editType: ej.Grid.EditingType.Boolean, displayAsCheckbox: true, defaultValue: false
},
{ field: "MouseResult", headerText: "Mouse" },
{
field: "HedgehogResult", headerText: "Hedgehog", editType: ej.Grid.EditingType.Boolean, displayAsCheckbox: true, defaultValue: false
},
{
field: "PossumResult", headerText: "Possum", editType: ej.Grid.EditingType.Boolean, displayAsCheckbox: true, defaultValue: false
},
{
field: "MustelidResult", headerText: "Mustelid", editType: ej.Grid.EditingType.Boolean, displayAsCheckbox: true, defaultValue: false
},
{
field: "OtherResult", headerText: "Other", editType: ej.Grid.EditingType.Boolean, displayAsCheckbox: true, defaultValue: false
}
],
create: function (args) {
args.model.keyConfigs.leftArrow = "";
args.model.keyConfigs.rightArrow = "";
args.model.keyConfigs.moveCellLeft = "shift+9,37";
args.model.keyConfigs.moveCellRight = "9,39";
}
});