Hi ,
In the webdatagrid, When I am changing a value in the one cell i am asking yes or no option. when I am clicking any option, it is updated using RowUpdating event, after that when I am refreshing the grid it is telling as "Requested record cannot be found by key". The JavaScript code is follows
var StatusValue; function WebDataGrid_EnteredEditMode(sender,evntArgs) { var grid=$find('<%=WebDataGrid.ClientID%>'); var row = evntArgs.getCell().get_row(); var currCell = evntArgs.getCell(); StatusValue=row.get_cellByColumnKey("Key_STATUS").get_value(); } function WebDataGrid_ExitedEditMode(sender, evntArgs) { var grid=$find('<%=WebDataGrid.ClientID%>'); var row = evntArgs.getCell().get_row(); var currCell = evntArgs.getCell(); if(evntArgs.getCell().get_column().get_key()=="Key_STATUS") { var a=row.get_cellByColumnKey("Key_STATUS").get_value() var StatusText; var retVal = window.confirm("Are do you want to change the value?"); if( retVal != true ) { if(StatusValue==1) { StatusText="Live"; } else if(StatusValue==2) { StatusText="Won"; } else if(StatusValue==3) { StatusText="Lost"; } else if(StatusValue==4) { StatusText="Cancelled"; } row.get_cellByColumnKey("Key_STATUS").set_text(StatusText); document.getElementById('<%=hidden.ClientID%>').value=StatusValue; } else { //Saving the database immediately. So, we are calling here WebDataGrid_RowUpdating server side event. document.getElementById('<%=hidden.ClientID%>').value=""; } var editingCore = grid.get_behaviors().get_editingCore(); editingCore.commit(); __doPostBack("<%= WebDataGrid.ClientID %>", ""); } }
Please do the needful.
hi Praveena,
Please let me know if you need any additional help. Thanks,
Angel
hey Praveena,
could you check if any of the suggestions in this thread helps you:
http://ko.infragistics.com/community/forums/t/74659.aspx
Thanks,