Recent

Author Topic: DBGrid editing control  (Read 548 times)

egsuh

  • Hero Member
  • *****
  • Posts: 1520
DBGrid editing control
« on: December 14, 2024, 04:00:33 am »
Is there any way to set DBGrid so that the content is set editible only when Dataset is set to  dsEdit mode via TDBNavigator, not directly by pressing F2 on the DBGrid?

dsiders

  • Hero Member
  • *****
  • Posts: 1322
Re: DBGrid editing control
« Reply #1 on: December 14, 2024, 05:45:36 am »
Is there any way to set DBGrid so that the content is set editible only when Dataset is set to  dsEdit mode via TDBNavigator, not directly by pressing F2 on the DBGrid?

You might be able to use OnSelectEditor and set its Editor argument to Nil if the Dataset state is not dsEdit.
Preview the next Lazarus documentation release at: https://dsiders.gitlab.io/lazdocsnext

silvercoder70

  • Full Member
  • ***
  • Posts: 118
    • Tim Coates
Re: DBGrid editing control
« Reply #2 on: December 14, 2024, 12:43:29 pm »
if you don't want to the user pressing F2... doesn't that make the app a little less friendly for users that prefer not to use a  mouse?

But ... if it were something permission related, then could you not try something with the dataset OnStateChange?

Explore the beauty of modern Pascal programming with Delphi & Free Pascal - https://www.youtube.com/@silvercoder70

 

TinyPortal © 2005-2018