SelectRow() problem if cell(s) = null

Jul 21, 2009 at 10:33 AM

I wanted to implement a row selection when clicking on row header event if the grid isn't in row mode. I've implemented a Controller for that and it works perfectly, but I've a problem with:

                    sender.Grid.Selection.SelectRow(sender.Position.Row, true);

The row isn't selected and if I call "sender.Grid.Selection.FocusFirstCell(false);", the first cell of the grid is focused.

Then I tried with this:

                    for (int c = 0; c < sender.Grid.Columns.Count; c++)
                    {
                        if (sender.Grid.GetCell(sender.Position.Row, c) != null)
                            sender.Grid.Selection.SelectCell(new SourceGrid.Position(sender.Position.Row, c), true);
                    }

And it works.

The last column of the row where I tried this are null. Is think there can be a problem with this, because when I use SelectRow where there isn't any null cell it works.