We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Virtual Grid - Deleting row but QueryCellinfo still fires .

i have a virtual grid and the Row count is based on the count of an arraylist. on the QueryRowCount i return arraylist.count; the issue is that when i put some code in so when the user hits "Ctrl_D" they delete the current row. here is the code that runs on the user hitting ctrl-D QuoteGrid.BeginUpdate(); //removes the item from the arraylist _quoteLegLocation.Remove(oldQuote_.ID + "+" + i); QuoteGrid.ResetVolatileData(); QuoteGrid.EndUpdate(); QuoteGrid.Refresh(); at this point i would expect everything to reset and repopulate without this row. The issue is that QueryCellInfo still fires for rows that no longer exists. If the grid had 7 rows before and now the size of the arraylist is 6.. i still get a querycellinfo event and when i look at the e.RowIndex, it equals 7. is this a bug ? any ideas. I currently put this check in but it seems to fundamentally confuse me about how this virtual grid should work. thks, ak

6 Replies

AD Administrator Syncfusion Team October 2, 2005 12:04 AM UTC

Where are you handling the ctl+D? Are you making sure there is not active currentcell when you delete the row (and that the currentcell does not try to handle the ctl+D also)? If there is a relick of the current cell still active when you try to delete the row, then that may be why QueryCellInfo is being raised to paint this cachhed current cell. So, try doing a grid.CurrentCell.CancelEdit before you remove teh row, and also make sure you do something so the grid does not also try to handle the ctl+D. Exactly what you would do to make sure of this depends upon where/how you are handling the ctl+D.


AK Adam K. October 2, 2005 09:42 PM UTC

i tried handling the Ctl+D in the Grid.KeyPress (looking for (char)4) and with the Grid.CurrentCellKeypress . .i had this issue with both . . I tried sticking in grid.CurrentCell.CancelEdit before i removed the row but i am still getting the same issue basically when this happens, i capture, on the QueryCellInfo even, the e.RowIndex and e.Rowcount i get e.Rowindex = 7 and e.RowCount = 6; any other ideas ?? thks, ak >Where are you handling the ctl+D? > >Are you making sure there is not active currentcell when you delete the row (and that the currentcell does not try to handle the ctl+D also)? If there is a relick of the current cell still active when you try to delete the row, then that may be why QueryCellInfo is being raised to paint this cachhed current cell. > >So, try doing a grid.CurrentCell.CancelEdit before you remove teh row, and also make sure you do something so the grid does not also try to handle the ctl+D. Exactly what you would do to make sure of this depends upon where/how you are handling the ctl+D.


AD Administrator Syncfusion Team October 2, 2005 11:51 PM UTC

Here is a minimal sample that deletes the current row in a virtual grid when you press ctl+D. http://www.syncfusion.com/Support/user/uploads/Virt_Delete_1f59bb92.zip


AD Administrator Syncfusion Team October 3, 2005 02:23 AM UTC

your example showed me the issue. I needed to move the cursor off of that last row before i deleted it.. thanks for your help -ak >Here is a minimal sample that deletes the current row in a virtual grid when you press ctl+D. > >http://www.syncfusion.com/Support/user/uploads/Virt_Delete_1f59bb92.zip > >


AK Adam K. October 30, 2005 09:25 PM UTC

This works fine but what if i only have 1 row and 1 column. where should i move the cursor to in this case ?? thks, ak >your example showed me the issue. I needed to move the cursor off of that last row before i deleted it.. > >thanks for your help > >-ak > >>Here is a minimal sample that deletes the current row in a virtual grid when you press ctl+D. >> >>http://www.syncfusion.com/Support/user/uploads/Virt_Delete_1f59bb92.zip >> >>


AD Administrator Syncfusion Team October 30, 2005 09:55 PM UTC

The sample above works ok for me if I delete all the rows.

Loader.
Live Chat Icon For mobile
Up arrow icon