I need to start a new discussion on the grid and double-click. I suppose we have recently started using the double-click event on the grid, but we need to discuss whether this is really possible in the context in which we use the grid. I will explain why.
For us the grid is an editable grid, which can be thought of as having two layers that are semi-independent. There is the data layer and the selection layer. So the data can 'move around' separate from the selection because the selection is based simply on the index of the row in the grid. The selection is not associated with data in any way. So we see this in a sorted grid - if the NEWCODE column is sorted A..Z and we create a new row, but edit the code to be AAAA then click in the grid, our new row 'jumps' to the top, and we have to track its selection. You know all about this already. But here's the thing - did you notice that, although you clicked on, say, row 5 after editing the text to AAAA, and you do now have row 5 selected the content of that row is now not what it was when you clicked on it - because when the row with AAAA got 'inserted' at the top, it pushed all the rows below it down by one. So if, instead of clicking on row 5 you had double-clicked, you would not act on the row that you expected.
Chris found another place last week where double-clicking did not give the expected result. In this case you see the issue if you shrink the window so that not all rows are visible at once. If you add your new row to an UNSORTED grid, your new row is visible as the bottom row in the grid and the view-port. Now, using the mouse, slide the scrollbar so that the new row is no longer visible. Now click on a row inn the middle of the grid. You will find that the row you selected is visible, but the scroll position has changed (probably) because when we call the method to ensure that a cell is shown, it is only sure to be shown somewhere in the grid, not at a particular row. So now, if your click is a double click, the first click on row X highlights the data row you expected, but the second click highlights the row at the position you clicked - and by now the data underlying that row has moved! Again your double click does not quite do what you expect.
Sorry if that was a bit too much detail - the key point is that data and selection are not locked together. When the focus row changes all we know is the new index of the the row. But validation - which MUST be called on any row change - can move the data around; and playing with the view-port ensures rows are visible, but again, by their index, not by their content.
So I am tempted to say that editable grids cannot support the double click event. I don't know any editable grid that would support this functionality. It is kind of odd to be editing something that is your 'active record' and then say that the double-click action has a meaning to that process. Double-clicking a grid might take you INTO edit mode for that record, but what does double-clicking mean when you are already editing?
I could make the following suggestion, although I am rather hesitant that it is a good idea, but I am interested what you think. It is a fairly well understood concept with database records that you are either in 'edit mode' or 'navigation mode'. You might even have some kind of visible indication of which mode you are in. So, for us, you are in edit mode if the grid does not have the focus and you are in navigation mode when the grid does have the focus. This is true whether the grid gets the focus when you tab to it or click on it. When in 'navigation mode' the cursor keys move you up and down, the mouse selects rows and double-click and ENTER have their special meanings. But when you are in edit mode (not grid focused) the navigation keys have no effect (obviously). But here's the thing - the transition from edit to navigation takes place when the grid gets the focus and the edit changes have been applied. So, in my first example of the sorted grid, if you edit NEWCODE to AAAA and click in the grid, the highlighted row becomes what it becomes (not necessarily the data for the row you clicked on) and then after that you can double click a row. Now I think that would be hard to explain to users - that double clicking works after edit mode has been activated.
So I think we have the following choices:
Double click is not available at all (though ENTER is still fine)
We implement some kind of edit/navigation mode
We think of something else
[/list:u]
Whatever we decide from the above, the grid as it is is not currently capable of supporting the functionality that we have started to implement.
Alan