Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
640
Adding a new Empty row in Webdatagrid
posted

Hi,

Currently, the new empty row is only opened when I press Enter Key. How can I open

the new row automatically after all the cell in the new row is filled that I have seen in your forum.Here is my javascript code.I want a new empty row to open on

exitededit mode. Please let me know how is this possible or if there is any other way to implement this. Also this javascript function is called each time I move from 

one cell to other cell in the same row.Is there any possibility to call this function once I have done with all the cell on row insert in the same row?

function dgAllocationOnInsert_CellInserting_ExitedEditMode(sender, eventArgs) {
var grid = $find("<%=dgAllocation.ClientID%>");
var gridBehaviors = grid.get_behaviors();
var row = gridBehaviors.get_selection().get_selectedRows().getItem(0);
var rowId = -1;
var allocTypeValue = '';
var fromType = eventArgs.getCell().get_row().get_cellByColumnKey("AL_ACCTTYPE").get_value();
allocTypeValue = eventArgs.getCell().get_row().get_cellByColumnKey("ST_NUM").get_value();
var year = document.getElementById('ctl00_ContentPlaceHolder1_baseLineYear').value;
var cc_id = eventArgs.getCell().get_row().get_cellByColumnKey("CC_ID").get_value();
var cc_idBoolValue = cc_id != "null" && cc_id != null;
var allocTypeBoolValue = allocTypeValue != "null" && allocTypeValue != null;
var fromTypeBoolValue = fromType != "null" && fromType != null;
var alTiming = eventArgs.getCell().get_row().get_cellByColumnKey("AL_TIMING").get_value();
var alTimingBoolValue = alTiming != null;
var allocid = null;
if (cc_id == "null") {
alert("Select FromCC");
}
if (allocTypeValue == "null") {
alert("Select AllocationType");
}
if (fromType == "null") {
alert("Select FromType");
}

if (cc_idBoolValue == true && allocTypeBoolValue == true && fromTypeBoolValue == true && alTimingBoolValue == true) {
abmAPI.updateAllocations(rowId,
allocid,
year,
cc_id,
eventArgs.getCell().get_row().get_cellByColumnKey("AL_ACCTTYPE").get_value(),
eventArgs.getCell().get_row().get_cellByColumnKey("AL_ACCTPATTERN").get_value(),
eventArgs.getCell().get_row().get_cellByColumnKey("AL_DESTPATTERN").get_value(),
allocTypeValue,
alTiming,
updateAllocationsHandler);
}

}