Update mysql from datagrid

Creating desktop or client-server database solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
DavJans
Posts: 275
Joined: Thu Dec 12, 2013 4:21 pm

Update mysql from datagrid

Post by DavJans » Thu Feb 13, 2014 9:03 pm

If there is a guide on this or lesson that would be great.
If not, this is how my brain is trying to get at it and maybe someone can help me.

#1 does the openField and closeField handlers work in a datagrid?

#2 I know how to get data in in a specific row based on what column it is in, what I need now is the name of the column I'm editing
after that, If closeField works in a datagrid I can then use the information I have gotten to update the data in my MySql server.
"Det bästa stället att hitta en hjälpande hand är i slutet av din egen arm" förutom här

Klaus
Posts: 14206
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Update mysql from datagrid

Post by Klaus » Fri Feb 14, 2014 2:22 pm

Hi DavJans,

1. not really!

2. You need to "catch" the "CloseFieldEditor" message, that is sent to the datagrid,
when the user finished entering data.

Put something like this into the script of the datagrid group, NOT into the behavior if present!

Code: Select all

on CloseFieldEditor pFieldEditor

   ## Get NAME of currently edited COLUMN:
   put the dgColumn of the target into theColumnBeingEdited

   ## Get newly entered content:
   put the text of pFieldEditor into tNewText
   ## Now you can update your database with the help of these infos.

   ## MOST IMPORTANT!
   pass CloseFieldEditor
end CloseFieldEditor
Hope that helps!


Best

Klaus


CloseFieldEditor

DavJans
Posts: 275
Joined: Thu Dec 12, 2013 4:21 pm

Re: Update mysql from datagrid

Post by DavJans » Fri Feb 14, 2014 4:45 pm

As always, you guys are the best, works perfectly.
Cant thank you enough
"Det bästa stället att hitta en hjälpande hand är i slutet av din egen arm" förutom här

Klaus
Posts: 14206
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Update mysql from datagrid

Post by Klaus » Fri Feb 14, 2014 5:11 pm

Hi DavJans,
DavJans wrote:Cant thank you enough
well, we could at least talk about that! :D


Best

Klaus

Post Reply