Unable to Tab from visible row to visible row if RowSpan > 1

Nov 23, 2009 at 2:13 PM

Good morning,

There seems to be a bug with SourceGrid.Grid when using the Tab Key to move from cell to cell within the grid.

If RowSpan = 1, the SourceGrid.Grid control behaves properly, and the user is able to go from cell to cell, and row to row when it reaches the end of a row. It also leaves the grid and move on to the next control when it reaches the last cell of the grid.

If RowSpan > 1, however, the SourceGrid.Grid control will not properly go from row to row when reaching the end of a row. Instead, it goes back to the start of the same row. Furthermore, it does not allow the user to leave the grid to move on to the next control in the form.

The user is still able to move from row to row by using the Up/Down arrow keys, however, he will not be able to leave the grid to move to the next control in the form by solely using the keyboard (at least, I have not been able to do so).

To reproduce this problem, update the frmSample17_Load(object sender, System.EventArgs e) method in the Sample 17 in the following manner:

Replace the paragraph that populates the grid with data with the following:

            Random rnd = new Random();
            for (int r = 1; r < grid1.RowsCount/2; r++)
            {
                grid1[r*2,0] = new SourceGrid.Cells.RowHeader("Header " + r.ToString());
                grid1[r*2,0].RowSpan = 2;
                for (int c = 1; c < grid1.ColumnsCount; c++)
                {
                    if (rnd.NextDouble() > 0.20)
                    {
                        grid1[r*2,c] = new SourceGrid.Cells.Cell(r*c, typeof(int));
                        grid1[r * 2, c].RowSpan = 2;
                    }
                    else
                        grid1[r*2,c] = null;
                    
                }
            }

 

Are there any workarounds?

Guillaume

 

Coordinator
Nov 25, 2009 at 12:55 PM

Hi Guillaume,

Actually this is a bug. It appeared when i fixed problems with row and col spanning, which where before.

 

I have commited a fix, it should now move to other row.

 

I have also extracted an interface IGridSelection. So now if you are not satisfied with how selection works, you can just provide your own implementation. SelectionBase class might be a good place to start.

 

Dec 1, 2009 at 6:52 PM

Hi Darius,

I just got the v4.22 source code, rebuilt the project, and replaced the paragraph that populates the grid with data with the following but I am still seeing the same issue - Is there a later version than v4.22?

Thanks,

 

Guillaume

            Random rnd = new Random();
            for (int r = 1; r < grid1.RowsCount/2; r++)
            {
                grid1[r*2,0] = new SourceGrid.Cells.RowHeader("Header " + r.ToString());
                grid1[r*2,0].RowSpan = 2;
                for (int c = 1; c < grid1.ColumnsCount; c++)
                {
                    if (rnd.NextDouble() > 0.20)
                    {
                        grid1[r*2,c] = new SourceGrid.Cells.Cell(r*c, typeof(int));
                        grid1[r * 2, c].RowSpan = 2;
                    }
                    else
                        grid1[r*2,c] = null;
                    
                }
            }

 

Coordinator
Dec 3, 2009 at 9:01 AM

Maybe you got source code from codeplex siste instead of bitbucket?

Newest source code is here http://bitbucket.org/dariusdamalakas/sourcegrid/

 

Dec 3, 2009 at 1:46 PM

AhHha- good point - my fault.thx


From: dariusdamalakas
To: Guillaume Escarguel
Sent: Thu Dec 03 02:01:25 2009
Subject: Re: Unable to Tab from visible row to visible row if RowSpan > 1 [sourcegrid:75960]

From: dariusdamalakas

Maybe you got source code from codeplex siste instead of bitbucket?

Newest source code is here http://bitbucket.org/dariusdamalakas/sourcegrid/

Coordinator
Dec 5, 2009 at 8:47 AM

No prob!

 

Does it work now?