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

Skipping Selection of a cell when navigating grid

I have a GDBG with GridBoundColumns in which I would like to skip selection of the cell in my first column when using tab or arrow keys to navigate the grid. This is a read only column and it doesn''t make sense to select this cell. How can I do this? Thanks, Jeff

6 Replies

AD Administrator Syncfusion Team February 4, 2005 04:50 PM

You can set GridStyleInfo.Enabled = false for these cells. Then they will be skipped. Stefan >I have a GDBG with GridBoundColumns in which I would like to skip selection of the cell in my first column when using tab or arrow keys to navigate the grid. This is a read only column and it doesn''t make sense to select this cell. How can I do this? > >Thanks, >Jeff


JL Jeff Lancaster February 4, 2005 05:01 PM

Thanks for the response. I had actually tried that approach but the problem with that is this: I have a lot of columns in my grid so horizontal scrolling is enabled. If I set GridStyleInfo.Enabled = False the column does show up on initial load and is not selected by arrow key navigation. However if I scroll to the right past the point where you can see the column, and then scroll back, the column is no longer visible. I want to be able to see the column, just not select it with the keyboard navigation. Thanks, Jeff


AD Administrator Syncfusion Team February 6, 2005 02:57 PM

Hi Jeff, ok. I would still keep using the .Enabled flag but you should also try handling the QueryNextCurrentCellPosition event. In the event handler for that event you could set grid.LeftColIndex = 1 to scroll the first column into view. Stefan >Thanks for the response. I had actually tried that approach but the problem with that is this: I have a lot of columns in my grid so horizontal scrolling is enabled. If I set GridStyleInfo.Enabled = False the column does show up on initial load and is not selected by arrow key navigation. However if I scroll to the right past the point where you can see the column, and then scroll back, the column is no longer visible. I want to be able to see the column, just not select it with the keyboard navigation. > >Thanks, >Jeff


JL Jeff Lancaster February 7, 2005 01:26 PM

Thanks, Stefan. That does seem to work, however it also causes an unwanted side effect. Each time I arrow to the right, the whole grid momentarily shifts all the way to the left, before repositioning itself to show the proper cell. Any other suggestions? Jeff


AD Administrator Syncfusion Team February 7, 2005 02:21 PM

Jeff, you need to check the arguments that get provided by this event. In your case you should look for CurrentCell.ColIndex = 2 and GridDirectionType.Left; Stefan > >Thanks, Stefan. > >That does seem to work, however it also causes an unwanted side effect. Each time I arrow to the right, the whole grid momentarily shifts all the way to the left, before repositioning itself to show the proper cell. > >Any other suggestions? > >Jeff


JL Jeff Lancaster February 7, 2005 02:51 PM

Thank you - that did the trick. By the way, I also had to check for ColIndex = 1 and GridDirectionType.Right (this was because I had set model.Options.WrapCell = True).

Loader.
Live Chat Icon For mobile
Up arrow icon