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.
Unfortunately, activation email could not send to your email. Please try again.

Virtual Grid - Deleting row but QueryCellinfo still fires .

Thread ID:

Created:

Updated:

Platform:

Replies:

35489 Oct 1,2005 09:37 AM Oct 30,2005 04:55 PM Windows Forms 6
loading
Tags: GridControl
Adam K.
Asked On October 1, 2005 09:37 AM

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

Administrator [Syncfusion]
Replied On October 1, 2005 08:04 PM

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.

Adam K.
Replied On October 2, 2005 05:42 PM

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.

Administrator [Syncfusion]
Replied On October 2, 2005 07:51 PM

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

Administrator [Syncfusion]
Replied On October 2, 2005 10:23 PM

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 > >

Adam K.
Replied On October 30, 2005 04:25 PM

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 >> >>

Administrator [Syncfusion]
Replied On October 30, 2005 04:55 PM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;