Thanks again for your help.
I made column 0 selectable. Not the best solution but it works for now. The paste logic in the program ignores column 0.
I then modified SelectionBase.cs\OnCellGotFocus(ChangeActivePositionEventArgs e)
Changing SelectCell(m_activePosition, true)
//Modified to select entire row if row header is clicked. JHM 4/10/2009
If (m_activePosition.Column == 0)
// Select the row
//Select the cell
Now it selects rows if the cell in column 0 is clicked.
In order to get the rows selected when draggin the mouse down, I modified GridVirtual.cs\OnMouseSelectionChange(EventArgs e)
Adding code to extend l_MouseRange as follows:
//Change the range to be full rows if the range contains column 0) JHM 4/10/2009
int startRow = Min(l_MouseRange.Start.Row, l_MouseRange.End.Row);
int endRow = Max(l_MouseRange.Start.Row, l_MouseRange.End.Row);
l_mouseRange = new Range(startRow, 0, endRow, Columns.Count - 1);
I still have on issue left. When selecting multiple rows or cells using the Control key, the rows or cells appear in the order clicked when I retrieve the selected range.
RangeRegion rangereg = grid.Selection.GetSelectionRegion()
PositionCollection cellsToCopy = rangereg.GetCellsPositions();
To correct this, I attempted to use the Sort method.
Which throws and error - Failed to compare two elements in the array. It looks like its basic assumption is that the array is an array of ints not an array of Positions.
I apologize but I don't understand the syntax of the first overload ... cellsToCopy.Sort(Comparison<type> comparison). Would you please provide an example?