How to define columncontrol in GRID ?

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
huangchenmin
Posts: 157
Joined: Mon Jun 07, 2010 2:24 am

How to define columncontrol in GRID ?

Post by huangchenmin »

I tried to follow sample as GRID.20 for columncontrol in GRID.
The meaage error message keep displaying while .exe was executed.
Could anyone help me to find that bug?
Best Regards
Attachments
MissOPD.zip
(97.39 KiB) Downloaded 212 times
User avatar
Rathinagiri
Posts: 5482
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: How to define columncontrol in GRID ?

Post by Rathinagiri »

Yes, the problem is if you want to have a combobox as the column control, you have to specify the row number in the items.

Please change your code like this
Attachments
Main.zip
(946 Bytes) Downloaded 232 times
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
huangchenmin
Posts: 157
Joined: Mon Jun 07, 2010 2:24 am

Re: How to define columncontrol in GRID ?

Post by huangchenmin »

rathinagiri wrote:Yes, the problem is if you want to have a combobox as the column control, you have to specify the row number in the items.
Please change your code like this
My Friend:
Thanks for your supports. It's real different from my imagination about "COMBOBOX". I thought COMBOBOX in GRID was able to pick up specificed item from listing. By the sample of GRID.20, HMG covert column that crossesponding to item of COMBOBOX, such as 1->"ONE"、2>"TWO".
huangchenmin
Posts: 157
Joined: Mon Jun 07, 2010 2:24 am

Re: How to define columncontrol in GRID ?

Post by huangchenmin »

rathinagiri wrote:Yes, the problem is if you want to have a combobox as the column control, you have to specify the row number in the items.
Please change your code like this
What is the syntax if there are only specificed cloumns need to define COMBOBOX in GRIG ?
For example,there are 4 column in GRID_1.
There is only 3th column need to define columncontrols, I had tried syntax as follow:
COLUMNCONTROLS {,,,{COMBOBOX',['ONE','TWO','THREE']}}
It did not work!
PLS HELP!
Best Regards
chen min
User avatar
Rathinagiri
Posts: 5482
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: How to define columncontrol in GRID ?

Post by Rathinagiri »

Hi,

If you specify columncontrol for one column, you have to specify for all columns. However, if you don't want the user to enter inside a column, you can use columnwhen specification. For example,

columncontrols {{'TEXTBOX','CHARACTER'},{'TEXTBOX','CHARACTER'},{'TEXTBOX','CHARACTER'},{'COMBOBOX',{'One','Two','Three'}}}
columnwhen {{||.f.},{||.f.},{||.f.},{||.t.}}
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
huangchenmin
Posts: 157
Joined: Mon Jun 07, 2010 2:24 am

Re: How to define columncontrol in GRID ?

Post by huangchenmin »

rathinagiri wrote:Hi,
.....
columncontrols {{'TEXTBOX','CHARACTER'},{'TEXTBOX','CHARACTER'},{'TEXTBOX','CHARACTER'},{'COMBOBOX',{'One','Two','Three'}}}
columnwhen {{||.f.},{||.f.},{||.f.},{||.t.}}
Sorry for replying late.
I am busy working on COMBOBOX in GRID, and eventually it is done.
It is successful due to your supports.
There comes another issue ,COLUMNVAILD syntax, for following processs after specificed nitem in combobox was selected.
Please help me to code right at line 89.
Best Regards
chen min
Attachments
MissOPDt.zip
(5.03 KiB) Downloaded 191 times
User avatar
Rathinagiri
Posts: 5482
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: How to define columncontrol in GRID ?

Post by Rathinagiri »

No problem,

Like the same way you have defined columnwhen, the same way you can define the columnvalid too.

Change like this.

Code: Select all

                    COLUMNVAILD {{||.t.},{||.t.},{||.t.},{||.t.},{||.t.},{||.t.},{||.t.},{||callresult()}}                    
Also, callresult() function should return either .t. or .f. ie to allow/disallow the user entry.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
huangchenmin
Posts: 157
Joined: Mon Jun 07, 2010 2:24 am

Re: How to define columncontrol in GRID ?

Post by huangchenmin »

rathinagiri wrote:No problem,
......................
Also, callresult() function should return either .t. or .f. ie to allow/disallow the user entry.
Thanks for your supports.
I had modified missopdt.prg as line 89 like the way you did.
COLUMNVAILD {{||.T.},{||.T.},{||.T.},{||.T.},{||.T.},{||.T.},{||.T.},{||callresult()}}
The error message keep displaying as "E0300 Syntax error as '{' "
Please help.
Best Regards
chen min
huangchenmin
Posts: 157
Joined: Mon Jun 07, 2010 2:24 am

Re: How to define columncontrol in GRID ?

Post by huangchenmin »

huangchenmin wrote:
rathinagiri wrote:No problem,

COLUMNVAILD {{||.T.},{||.T.},{||.T.},{||.T.},{||.T.},{||.T.},{||.T.},{||callresult()}}

chen min
OK!
This is not a joke.
I did a stupid mistake for typed 『COLUMNVALID』 as 『COLUMNVAILD』

Best Regards
chen min
Post Reply