How can I program to move to cells[ACol, ARow) ? I can't find any SelectCell / MoveToCell or similar. Anybody can pls. push me into the right direction?
This feature is already built in under Options.Keyboard.EnterKeyHandling and Options.Keyboard.TabKeyHandling which internally verifies if the next cell is readonly / fixed or not and skips it automatically. If you still want to manage it programmatically you can retrieve the next selectable column / row with
right now the cursor stops inside the readonly cell. I set the options as fallows :
with options do
begin
Keyboard.EnterKeyHandling:= ekhNextColumn;
Keyboard.EnterKeyDirectEdit:= true;
Keyboard.TabKeyDirectEdit:= true;
Keyboard.TabKeyDirection:= tkdNextColumnCell;
Keyboard.TabKeyHandling:= tkhNextCell;
end;
Columns[6].Width:= 75;
Columns[6].HorzAlignment:= gtaTrailing;
Columns[6].ReadOnly:= true;
I tested it under Windows7 with Lazarus 1.6 - x64 / Lazarus trunk both with win32 and qt widgets
Another thing is, that whwn using the TAB key for navigating through the cells, its switching first off the edit mode and when presssing TAB a second time moving to the next cell.
Any options to avoid that? I would like to have the grid permanent in edit mode.
Thank you for this information, you are doing a great job! I have one another need for the grid navigation :
I'm not only defining columns/cells read only, I also would like to have columns/cells to skip when pressing TAB or ENTER key. Its like defining tab stops for columns/cells.
I started to extend the class TTMSFNCGridColumn by
Linux Mint 17.3 / Lazarus 1.6 / qt & gtk2 widgets / TMS FNC UI Pack v1.0.3.0
Hello,
after updating the package the only difference I noticed is, that when pressing TAB key its navigating in the same way as using the ENTER key except on the read only columns/cells.
TAB key : Still focus the read only column but move to the next column/cell on the next TAB key press
ENTER key : Focus the read only column/cell and stays there
Just to be sure that I upgraded to the correct package : The grid has the version 1.0.0.5
The behavior is by design, a readonly cell can be navigated to, with the TAB key and Enter key.
The issue we have fixed is that the TAB Key or Enter key wouldn't navigate to the next cell. To skip readonly cells you need to set the cell to fixed, via the code below. A fixed cell has a different appearance, so you need to override this as well:
The Navigate is only showing the cell, if the cell is out of range it will automatically scroll, but not select the cell. When there is no scrolling involved Navigate will not change the grid visually. To select the cell you need to use TMSFNCGrid1.SelectCell(MakeCell(45, 45)); which calls Navigate internally.
thank you for your quick response. I guess I got it now. That is also the reason why the event OnSelectCell() is not occuring after executing Navigate()
I guess originally I was looking for the EditCell() method, to move to the wanted column/cell