This forum is temporaily read-only. All existing discussions remain available for reference. For new questions, bug reports or support requests, please contact us at mail@lmdsupport.com.

TLMDGrid read cell/row/column focus and SetFocus()

Hello.

I need to read cell focus in form of row & cell cords. How can I do it ?

Comments

  • You can use Grid.CurrentRow and Grid.CurrentColumn properties.
  • edited July 2018
    Allright - solves my first problem with getting cords but how about setting all columns focus of specific row by clicking on any of the them ? For example I have 2x3 grid and I am clicking cell [1][1] and I want to highlight [0][1] and [1][2] etc.
  • May be RowSelect mode will work for you, which you can turn On in Grid.Options...
  • Thanks - it works. I got another question - how to set focus on entire row/column/specific row & column ? Is it even possible ? I am asking about something like Grid.setFocus(row,column).
  • You can still use Grid.CurrentRow and Grid.CurrentColumn properties properties to select required cell. Then, use Grid.SetFocus method (standard VCL method).
  • Allright but if I am correct then SetFocus is void method so you cannot pass row and column to it. Is there any other way to do it ?
  • As noted, you should use Grid.CurrentRow and Grid.CurrentColumn properties properties to select required cell. And only then, use Grid.SetFocus method:

    Grid.CurrentRow := 3;
    Grid.CurrentColumn := 3;
    Grid.SetFocus;
Sign In or Register to comment.