We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Row selection problem

Hi Clay, 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

7 Replies

AD Administrator Syncfusion Team August 25, 2004 12:50 PM UTC

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.

IR Irina August 25, 2004 01:23 PM UTC

Thanks Clay. 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. Thanks

AD Administrator Syncfusion Team August 25, 2004 01:51 PM UTC

I tried to see such a problem in this sample and could not (using the latest release Can you see the problem in this sample? If so, what steps do I take to see it?

AD Administrator Syncfusion Team August 25, 2004 01:52 PM UTC

IR Irina August 25, 2004 05:32 PM UTC

Thanks Clay, It works now.

RA radwan March 27, 2018 06:39 PM UTC


SN Sindhu Nagarajan Syncfusion Team March 28, 2018 04:26 AM UTC

Hi Radwan, 
Thanks for the update.  
Please let us know if you need any further assistance on this. 

Live Chat Icon For mobile
Up arrow icon