Hey Steve - I've implemented this functionality in my grids and it did fix my problem, however, what I'm seeing now is complaints about editing from cell to cell. Essentially, when encapsulating the UpdateData inside the BeginInvokeOnMainThread, it causes the user to perform 4 clicks to move into editing a new cell. 2 Clicks on the new cell will take the old cell out of editing mode and 2 more clicks to get into editing of the new cell. Without the BeginInvokeOnMainThread, 2 clicks onto a new cell will automatically end editing and start editing the new cell.
Do you have any alternatives? Also, I use the UpdateData to always have a blank row at the bottom of the grid for new data entry which we've discussed in previous discussions and the BeginInvokeOnMainThread was prevent an exception when in EditMode and scrolling up in the grid.
Let me know what you think.
Attached is an old sample file that assists in explaining the issue.
Hi!
How about this:
if (!anotherCellEnteringEditMode) { this.BeginInvokeOnMainThread (() => { gridView.UpdateData (); }); }
What was happening, was that calling UpdateData was interrupting the call of putting the next cell into edit mode.
Luckily, we know when another cell is going into edit mode, via that additional parameter.
Would that work for you?
-SteveZ
Replying under my companies purchased license account from now on).
Anyways, it's a slight improvement and does prevent the 4 click edit. But the real issue now, is when adding in the new row, Editing from cell to cell (in the blank row) does not add another row to the bottom of the grid for another entry to be added. I've attached the sample app we've been using with the reflected changes.
To duplicate the issue, edit the blank row, then edit the next cell to the right, a blank row will not be added unless the done button is clicked. Unfortunately this will cause an issue for out users.
I hoping to keep this blank row at the bottom, because it adopts the same functionality as our win forms version. However, if this is unobtainable I can take a different approach if necessary, but would like to have it work like this if possible.
Thanks Steve this is working great. Hopefully, this will be all.
Ok, how about something like this:
public class customHelper : IGGridViewDataSourceHelper { public IGCellPath newEditPath; public override void BeginEditing (IGCellPath cellPath, IGGridView gridView) { newEditPath = cellPath; base.BeginEditing (cellPath, gridView); }
}
Add a new property or field on your DSH that exposes the cell thats about to go into edit mode.
Then use the following:
this.BeginInvokeOnMainThread (() => { gridView.UpdateData (); if(anotherCellEnteringEditMode) { customHelper dsh = (customHelper)dataSource; this.BeginInvokeOnMainThread (() => { dataSource.BeginEditing(dsh.newEditPath, gridView); }); } });
Basically, all we're doing is storing off the path that was going to go into edit mode, and then after we update, we force that cell back into edit mode.
Let me know if this works for you.