K
Kyle S A
Guest
I am trying to get my Datagridview to work in virtual mode by following the following Walkthrough: Implementing Virtual Mode in the Windows Forms DataGridView Control
http://msdn.microsoft.com/en-us/library/15a31akc%28v=vs.90%29.aspx
I have stumbled across an issue where the Rowcount value seems to be incrementing when it should not be.
Here is what I did:
This error does not occur if I exit out of the new row (press Esc 2 times). Click on the row with some data then return back to the new row and enter some text/data.
I am wondering what I can change to fix this issue.
Edit: I forgot to mention that when the error occurs the NewRowNeeded event is fired when I first try and edit the cell, but it is not fired a second time when I re-enter the cell after escaping out of the row edit.
I assume that this is what is causing the error, but dont know why this event isnt being called a 2nd time even though it is incrementing the row count from 2 to 3.
Continue reading...
http://msdn.microsoft.com/en-us/library/15a31akc%28v=vs.90%29.aspx
I have stumbled across an issue where the Rowcount value seems to be incrementing when it should not be.
Here is what I did:
- The dgv is implemented with one data row (Customers count is 1)
- There is one blank row for a new item to add
- If I begin editing a cell in the new row, but enter sometext and press escape 2 times (exit the row edit). The rowcount value is 3 when entering text but changes back to 2 after exiting row edit
- I then begin editing the cell again (row count value is still 2) and enter some text into it. At this point the CellValueNeeded event is called (after first character is entered) with a RowIndex of 1 and rowcount of 3. This causes an exception to be thrown because it only have 1 customer entered and it is trying to access the customer at the 2nd array location
This error does not occur if I exit out of the new row (press Esc 2 times). Click on the row with some data then return back to the new row and enter some text/data.
I am wondering what I can change to fix this issue.
Edit: I forgot to mention that when the error occurs the NewRowNeeded event is fired when I first try and edit the cell, but it is not fired a second time when I re-enter the cell after escaping out of the row edit.
I assume that this is what is causing the error, but dont know why this event isnt being called a 2nd time even though it is incrementing the row count from 2 to 3.
Continue reading...