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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridDataBoundGrid row focus

Thread ID:

Created:

Updated:

Platform:

Replies:

44499 May 25,2006 10:00 AM UTC May 30,2006 07:44 AM UTC WinForms 7
loading
Tags: GridControl
xiaojie
Asked On May 25, 2006 10:00 AM UTC

hi, i am trying to let focus stay on one row i click on..as i am working on the contextmenu on the grid. i need to get the data of the current row so i would like focus on the row i selected.. but as data comes in the focus shift upwards ,the focus always stay on the same rowindex..i want it to stick to the row i selected.. thanks

Administrator [Syncfusion]
Replied On May 25, 2006 11:09 AM UTC

Hi Pam, Try setting the SelectCellsMouseButtonsMask to excluded MouseButtons.Right to see if that helps. Below is a code snippet. this.gridDataBoundGrid1.Model.Options.SelectCellsMouseButtonsMask = this.gridDataBoundGrid1.Model.Options.SelectCellsMouseButtonsMask ^ MouseButtons.Right; Regards, Calvin.

xiaojie
Replied On May 25, 2006 12:38 PM UTC

Hi Calvin: thanks for replying, but the code does''t work, i just want to be able to right click and then the context menu comes up and the row i selected always gets the focus... thanks

Administrator [Syncfusion]
Replied On May 26, 2006 04:52 AM UTC

Hi Pam, Sorry, I am not able to understand the requirement clearly. Do you want the selected row not to change to the row where you have right clicked to pop up the context menu, or do you want to select the row where you have right clicked to pop up the context menu? The above code is for the first option. To select the row where you have right clicked set the SelectCellsMouseButtonsMask to include the MouseButtons.Right . Below is a code snippet. this.gridDataBoundGrid1.Model.Options.SelectCellsMouseButtonsMask |= MouseButtons.Right; Let us know if you are looking for something different. Regards, Calvin.

xiaojie
Replied On May 26, 2006 08:48 AM UTC

Hi Calvin sorry for the confusion.. wut I want is the focus of the row in the grid stays as it is, the highlighted row will always be the row i clicked on, either right click or left click. as there are many messages coming in filling up the grid, and the row i selected will sink to the bottom or get outside of view, but I would like it still have the highlight.. so that when I bring up the contextmenu, the function does not pick up the wrong data just because the highlighted row is different.. thanks

grid11.zip

Administrator [Syncfusion]
Replied On May 26, 2006 10:24 AM UTC

Hi Pam, Try setting the ListBoxSelectionMode to One to see if that helps. Below is a code snippet. this.gridDataBoundGrid1.ListBoxSelectionMode = System.Windows.Forms.SelectionMode.One; Regards, Calvin.

xiaojie
Replied On May 26, 2006 02:32 PM UTC

hi Calvin: i doesnt work.. are there other ways to freeze focus? thanks Pam

Administrator [Syncfusion]
Replied On May 30, 2006 07:44 AM UTC

Hi Pam, Sorry for the delayed response. The selected current record can be set fixed in the selected potion when the grid is being populated, by setting the TopRowIndex property of the grid in the Binder.CurrentPositionChanged event handler. Sample attached. Let us know if this helps. Regards, Calvin.

44499.zip

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.

Warning Icon 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.Close Icon

;