Hello, I'm wondering what your thoughts are on this situation:
I have a grid that has an "Add New Row" button... all this does is add another object to the bindinglist that the grid is using as a datasource, so immediately the row shows up and I put the cursor in the first cell of the new row in edit mode for their convenience. I'm using the initializelayout event to add an unbound column called 'Action' that has a delete button in it. I'm handling the CellClickButton to delete rows from the underlying bindinglist.
I'm also using BeforeExitEditMode to determine if the user has entered valid values. if they leave a required field blank, I ask them if they are sure and if so, to click 'OK', which will remove the underlying object from the bindinglist, which remoes the row from the grid.
The problem situation is... if they add a new row and before entering any data, the cursor goes to the first cell of the empty row, but they click the "Delete" button for that row... my BeforeExitEditMode event fires, as expected because the cursor left the first cell... it then prompts them if they are ok with removing the row, and if you click yes, it removes the row and then crashes... presumably because the CellClickEvent then fires, but is invalid because the object doesn't exist anymore.
What are your thoughts on this situation? I may need to cancel the CellClickButton event somehow... but not sure how to do that.
Thanks
Rocky
Mike, thanks... you're right, the event isn't firing so I can't check for existence on the row... we may have a license for 8.2 now so I'll see if I can use an 8.2 grid instead and see what it does.
For now, just to get by, I removed the X icon from the new row and am letting the beforeexiteditmode event handle if the newly added row get's to stay, instead of giving them the delete icon.
Thanks!
Hi Rocky,
Is the event actually firing? If so, then you could check to see if the row exists. If it's not actually firing, then there's really not much you can do about that - although I would consider this in a bug in the grid.
If the event is not firing, and you therefore cannot trap the error, I'd recommend getting the latest service release. Perhaps the issue is already fixed.
How to get the latest service release - Infragistics Community
If that doesn't help, then the next step would be to try it in the latest version of the controls. No more updates are being made to v6.2, but you could download a trial version of the latest (v9.2) and see if the problem has been fixed.
If it's still not fixed in v9.2, then the next step is for us to try to reproduce the crash and get it fixed.
Also, I should note this is the Ultrawingrid v6.2 I believe.