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.
Unfortunately, activation email could not send to your email. Please try again.

Row selection problem

Thread ID:

Created:

Updated:

Platform:

Replies:

18178 Aug 25,2004 08:29 AM Mar 28,2018 12:26 AM Windows Forms 7
loading
Tags: GridControl
Irina
Asked On August 25, 2004 08:29 AM

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

Administrator [Syncfusion]
Replied On August 25, 2004 08: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.

Irina
Replied On August 25, 2004 09:23 AM

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

Administrator [Syncfusion]
Replied On August 25, 2004 09:51 AM

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

Administrator [Syncfusion]
Replied On August 25, 2004 09:52 AM


Irina
Replied On August 25, 2004 01:32 PM

Thanks Clay, It works now.

radwan
Replied On March 27, 2018 02:39 PM

yes

Sindhu Nagarajan [Syncfusion]
Replied On March 28, 2018 12:26 AM

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


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;