Thanks.
<ej:Grid ID="FlatGrid" runat="server" AllowPaging="True" AllowScrolling="true" EnableRowHover="False">
<Columns>
----------------------
</Columns>
<ClientSideEvents RowSelected="rowSelect" ActionComplete="complete"RecordDoubleClick="doubleclick" />
<EditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true" />
<%--<ScrollSettings Height="100%" />--%>
<ToolbarSettings ShowToolbar="True" ToolbarItems="search,excelExport,pdfExport"></ToolbarSettings>
</ej:Grid>
-----------------------------------
<script>
function doubleclick(args) {
if(args.cell.parents().hasClass("e-frozencontentdiv"))
this.model.columnName = this.getColumnByIndex(args.cellIndex).field;
else {
args.cellIndex = args.cellIndex + this.model.scrollSettings.frozenColumns;
this.model.columnName = this.getColumnByIndex(args.cellIndex).field;
}
}
function complete(args) {
if (args.requestType == "beginedit") {
var grid = $("#MainContent_Grid1").ejGrid("instance"); // taking the grid instace using grid ID
var elem = $("#MainContent_Grid1" + grid.model.columnName); // to get the Grid edit cell
if (elem.hasClass("e-dropdownlist")) // if the selected value is dropdown
elem.closest(".e-ddl").focus();
else if (elem.hasClass("e-numerictextbox")) // if the selected value is numeric textbox
elem.siblings('input:visible').first().select().focus();
else
elem.focus().select(); // to foxus the element
}
} </script> |