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

Moving between cells using keys

Hi, I have tried to engage keyboard keys (Enter, arrow keys) to move around a datagrid. The idea is to capture data that is being entered into the current cell and to move to the cell next to the selected. For some reason, property that I have set to the grid this.gdbgClient.Model.Options.EnterKeyBehavior = GridDirectionType.Right is not working, merely no response when the Enter Key is pressed. Any ideas on how to resolve it would be appreciated. Also, how do I move between cells with the keyboard arrow keys? Thanks

4 Replies

AD Administrator Syncfusion Team April 12, 2005 07:51 PM

Have you set any cells so that their style.Enabled = false? If so, these cells cannot become the currentcell, and this affect the EnterKeyAction behavior. Is grid.WantsEnterKey = true? If not, the grid will ignore it. Have you handled any key events that might affect this behavior? If you drop a GridControl on a form and do not set any additional properties or handle any events, the enter key will move the current cell to the right by default.


IK Igor Kashtelyan April 14, 2005 01:09 PM

Thanks Clay, Actually, I inherited the application in its current version. Keys (either arrow keys or Enter) do not work as you have described (default?..). What I did, I handle an event gdbgrid_CurrentCellKeyDown. Than, based on e.Keys value, I handle the cursor move. Obviously, not the best way to do, but it works for now. I would really appreciate if you could tell me if there is something that prevents keys from moving around the grid. I checked for “style.Enabled = false” and it is not set (although several places have it commented). What I did found, is Style.ReadOnly = true. We also have a current issue with vertical scrolling. It is very slow in a sense that refresh is trailing by two-three seconds after the scroll bar is moved down. This happens on a grid of over 30-40 records. I understanding is that this amount (and it is the whole DataSet) should in no way affect the refresh unless something is done wrong What I am trying to do, is to optimize the existing app, so it will work faster and be more user friendly. Any good example on visual grid manipulations that I can use?.. Thanks. >Have you set any cells so that their style.Enabled = false? If so, these cells cannot become the currentcell, and this affect the EnterKeyAction behavior. > >Is grid.WantsEnterKey = true? If not, the grid will ignore it. > >Have you handled any key events that might affect this behavior? > >If you drop a GridControl on a form and do not set any additional properties or handle any events, the enter key will move the current cell to the right by default.


AD Administrator Syncfusion Team April 14, 2005 01:41 PM

Check your output window to see if any exceptions are being thrown. Exceptions will cause things to slow down. Once you have confirmed that there are no exceptions being thrown, then you really should not have to do anything to get the arrow keys to work. I would start out by commenting out all the grid events that you are handling to see any the these events are affecting this behavior. If you can upload a sample project showing the problem, we can probably spot what is causing this behavior.


IK Igor Kashtelyan April 14, 2005 03:20 PM

Clay, Thank you for the hint. I did indeed noticed that there is a bunch of exceptions being caught in the output window: catched at Syncfusion.Windows.Forms.Grid.GridModel.OnQueryCellInfo(GridQueryCellInfoEventArgs e) in :line 0 This starts only when the a pointer on the grid left side (►) points to the last row that has data (there is one more row at the bottom that is empty and is intended for insert new data). The app keeps throwing exceptions until this row goes off the view. The same is happening when a scroll bar is used. This is why originally, it was reported as a “slow scroll issue”. I am going to dig into this, although it is not clear now what causes this exception being thrown. Igor.

Loader.
Live Chat Icon For mobile
Up arrow icon