diff --git a/src/Eto.Gtk/Forms/Cells/CustomCellHandler.cs b/src/Eto.Gtk/Forms/Cells/CustomCellHandler.cs index 90a9699277..31e6573476 100644 --- a/src/Eto.Gtk/Forms/Cells/CustomCellHandler.cs +++ b/src/Eto.Gtk/Forms/Cells/CustomCellHandler.cs @@ -64,19 +64,22 @@ class Renderer : Gtk.CellRenderer { WeakReference handler; int editingRow = -1; + object editingItem; public CustomCellHandler Handler { get { return (CustomCellHandler)handler.Target; } set { handler = new WeakReference(value); } } protected override void OnEditingStarted(IGtkCellEditable editable, string path) { - //base.OnEditingStarted(editable, path); + // base.OnEditingStarted(editable, path); editable.EditingDone += Editable_EditingDone; editingRow = row; + editingItem = Item; } private void Editable_EditingDone(object sender, EventArgs e) { editingRow = -1; + editingItem = null; var editable = sender as IGtkCellEditable; if (editable == null) return; @@ -87,6 +90,7 @@ protected override void OnEditingCanceled() { //base.OnEditingCanceled(); editingRow = -1; + editingItem = null; } int row; @@ -154,7 +158,7 @@ protected override void Render(Gdk.Drawable window, Gtk.Widget widget, Gdk.Recta if (h == null) return; - if (editingRow == row) + if ((row != -1 && editingRow == row) || ReferenceEquals(editingItem, Item)) { return; } @@ -220,7 +224,8 @@ protected override unsafe void OnRender(Cairo.Context cr, Gtk.Widget widget, Gdk } #endif - if (editingRow == row) + + if ((row != -1 && editingRow == row) || ReferenceEquals(editingItem, Item)) { return; }