Index: DataGrid.cs
===================================================================
RCS file: /cvsroot/SmartLibrary/Forms/DataGrid.cs,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- DataGrid.cs	11 Jun 2004 14:13:13 -0000	1.19
+++ DataGrid.cs	17 Jun 2004 15:24:19 -0000	1.20
@@ -233,6 +233,9 @@
 
 		protected override void OnCurrentCellChanged(EventArgs e) 
 		{
+			this.lastvertval = this.VertScrollBar.Value;
+			this.stickyvert = true;
+
 			if (!inUpdateMode)
 			{
 				if (inEditMode && !this.CurrentCell.Equals(editCell))
@@ -275,6 +278,8 @@
 				}
 			}
 			base.OnCurrentCellChanged (e);
+
+			this.stickyvert = false;
 		}
 
 		private void TextBoxFocusTimer_Tick(object sender, EventArgs e)
@@ -391,6 +396,24 @@
 			this.SetEditTextBoxLocation ();
 			this.Invalidate ();
 			this.Update ();
+
+			if (this.stickyvert)
+			{
+				this.DetachAnyScrollBarEvent();
+				this.VertScrollBar.Value = this.lastvertval;
+				this.AttachAnyScrollBarEvent();
+			}
+
+		}
+
+		private int lastvertval=-1;
+		private bool stickyvert=false;
+		protected override void OnClick(EventArgs e)
+		{
+			this.lastvertval = this.VertScrollBar.Value;
+			this.stickyvert = true;
+			base.OnClick (e);
+			this.stickyvert = false;
 		}
 
 		private void Constructor () 

