Could you please help to fix two related problems:
1. I click row and column 1 to highlight a row. Then I click down arrow on the keyboard to move to the next row. It moves triangle, but doesn’t highlight the next row.
2. I am on tabpage1. I highlight a row 3 by clicking on that row and column 1. The triangle is correct and row is highlighted. Then I moved to tabpage 2. When I move back to tabpage 1, the first row has triangle but the row 3 still highlighted. The down arrow does not work now.
So how to make highlighted row be a current row, i.e. coordinate the highlighting with the triangle?
Thanks in advance
ADAdministrator Syncfusion Team August 25, 2004 07:50 AM
1) If you use grid.ListBoxSelectionMode = SelectionMode.one, then the grid will make sure the row selection moves with the current cell.
If you do not set this property, then selected rows are not related to teh current cell (current row). So, there is no attempt by the grid to keep these two different things in sync.
In this case, if you want selected row to move with the current cell, then you will have to handle probably two events, SelectionsChanging to remember that a row was selected, and then CurrentCellMoving (or Moved maybe) to actully unselect the old row and select the next current row after the cell has moved. To select a row you can use grid.Selections.Add or grid.Selections.SelectRange. But if setting the ListBoxSelectionMode property will serve your needs, that would be the simplest way to handle things.
2) Using ListBoxSelectionMode may take care of this problem also.
If not, I suspect the selections are not being seen because the grid does not get the focus when you click teh tab. Maybe catching an event that is raised when the new tab is shown, an dthere explcitly doing grid.Focus() will make this problem go away.
IRIrinaAugust 25, 2004 08:23 AM
I used grid.ListBoxSelectionMode = SelectionMode.one and grid.SetFocus() and it solved all problems except one: when I use down arrow to move let''s say from row 1 to row 3, visually everything is okay, but in debugger the cc.RowIndex still is 1, not 3. Only if I highlight row by clicking, it changes the RowIndex...So I cannot pick up correct text from the cell.
ADAdministrator Syncfusion Team August 25, 2004 08:51 AM
I tried to see such a problem in this sample and could not (using the latest release 220.127.116.11). Can you see the problem in this sample? If so, what steps do I take to see it?
ADAdministrator Syncfusion Team August 25, 2004 08:52 AM