Hello!
I have the 7.1 webgrid bound to a database and virtual LoadOnDemand. If i scroll down and try to delete a row by the delete-key, a unhandled exception is thrown in the javascript generated by the grid at this position:
function igtbl_deleteSelRows(gn){ var gs=igtbl_getGridById(gn); var ar=gs.getActiveRow(); if (ar && ar.IsAddNewRow) return; var del=false; if(igtbl_inEditMode(gn)) { igtbl_hideEdit(gn); if(igtbl_inEditMode(gn)) return; } if(gs.Node) { var arOffs=ar?ar.getIndex():0; gs.isDeletingSelected=true; var arr=igtbl_sortRowIdsByClctn(gs.SelectedRows); for(var i=0;i<arr.length;i++) { var row=gs.getRowByLevel(arr); if(row.deleteRow()) {
The row - object at this point is null because there is no row at the position "arr.
This problem only occurs, if i want to delete a row with an index greater than the "UltraWebGrid.DisplayLayout.rowsRange".
Any suggestions?
Thank you canettas! With your help, i found a workaround:I added a ClientSideEvent: grid.DisplayLayout.ClientSideEvents.KeyDownHandler = "multipleChoiceGrid_KeyUpHandler". I think it overrides the Infragistic's javascript event. Anyhow...it works!
function multipleChoiceGrid_KeyUpHandler(gridName, cellId, key){ if(key.toString() == ""13"") //here should be "DELETE" { var oRow = igtbl_getRowById(igtbl_getGridById(gridName).ActiveRow); var id = oRow.getCell(0).getValue(); __doPostBack("multipleChoiceGrid.Delete",id); }}
In my case, the first column is for the IDs (and it's hidden). Now you can check in the Page_Init (or anywhere else) if a row is deleted:
If Request.Form("__EVENTTARGET") = "multipleChoiceGrid.Delete" Then deleteRow(id)End If
Yes, I've related the following issue to Infragistics and still no answer...
I've partially solved the problem by doing the following steps:
- Turn the activation object off: I think that's only going to cause you trouble if you are using it to get something of the grid, like active rows....I don't know why this turns the client-side function keyDownHandler off.....
Then you can add a delete button to the page, when you click the button, you can hide the selected rows, and report to the server by invokeXMLRequest so that it can update the objectDataSource....
Then, the next time you move the scroll, those lines will disapear...
That's not an elegant solution and I wish Infragistics pay more atention in Virtual Load On Demand....but it solves the problem for now.
Great.
If you can remember, when you get a resolution it would be great if you could post the info to this thread. I'm sure there are other curious minds wondering what the problem is as well.
I just updated to version 7.1.20071.1055 - no difference.
I tried it with a SQLDataSource and a dataTable.
And I also reported it to the Developer Support.
If you're using the RTM version, you may want to check and see if a hotfix is available. Also, are you databinding yourslef, or are you connected to a SQLDataSource? It's probably a good idea to report this to our Developer Support team as well, so they can check if this is a known issue.