private void PlaceTextInCell(bool resetSelection, GridRangeInfo activeRange) { if (activeRange.IsEmpty) { return; } string range = GridRangeInfo.GetAlphaLabel(activeRange.Left) + GridRangeInfo.GetNumericLabel(activeRange.Top); if (activeRange.Top != activeRange.Bottom || activeRange.Left != activeRange.Right) { range += ':' + GridRangeInfo.GetAlphaLabel(activeRange.Right) + GridRangeInfo.GetNumericLabel(activeRange.Bottom); } TextBox gtb = grid.CurrentCell.Renderer.CurrentCellUIElement as TextBox; if (gtb != null) { int start = gtb.SelectionStart; gtb.SelectedText = range; if (resetSelection) { gtb.SelectionStart = start + range.ToString().Length; gtb.SelectionLength = 0; } else { gtb.SelectionStart = start; gtb.SelectionLength = range.ToString().Length; } placeTextDone = true; currentCellModified = true; InvalidateHeaders(); } }