How to define columncontrol in GRID ?
Moderator: Rathinagiri
-
huangchenmin
- Posts: 157
- Joined: Mon Jun 07, 2010 2:24 am
How to define columncontrol in GRID ?
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
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
- 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 ?
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
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.
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 ?
My Friend: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
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 ?
What is the syntax if there are only specificed cloumns need to define COMBOBOX in GRIG ?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
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
- 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 ?
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.}}
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.
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 ?
Sorry for replying late.rathinagiri wrote:Hi,
.....
columncontrols {{'TEXTBOX','CHARACTER'},{'TEXTBOX','CHARACTER'},{'TEXTBOX','CHARACTER'},{'COMBOBOX',{'One','Two','Three'}}}
columnwhen {{||.f.},{||.f.},{||.f.},{||.t.}}
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
- 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 ?
No problem,
Like the same way you have defined columnwhen, the same way you can define the columnvalid too.
Change like this.
Also, callresult() function should return either .t. or .f. ie to allow/disallow the user entry.
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()}}
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
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 ?
Thanks for your supports.rathinagiri wrote:No problem,
......................
Also, callresult() function should return either .t. or .f. ie to allow/disallow the user entry.
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 ?
OK!huangchenmin wrote:rathinagiri wrote:No problem,
COLUMNVAILD {{||.T.},{||.T.},{||.T.},{||.T.},{||.T.},{||.T.},{||.T.},{||callresult()}}
chen min
This is not a joke.
I did a stupid mistake for typed 『COLUMNVALID』 as 『COLUMNVAILD』
Best Regards
chen min