Sort property in Grid Combobox

Creative ideas/suggestions for HMG

Moderator: Rathinagiri

Post Reply
User avatar
sudip
Posts: 1454
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Sort property in Grid Combobox

Post by sudip »

Hello Roberto,

Is it possible to have "Sort" property in Grid Combobox?

Rathi showed us how to use achoice (or combo search box) with grid. (Many thanks to Rathi. )

Again, it will be easier for us if we have Sort property in Grid combobox.

It's not necessary, but it will be helpful. :)
With best regards,
Sudip
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Sort property in Grid Combobox

Post by Rathinagiri »

Hi Sudip,

I too have thought of and tried implementing the 'sort' feature inside the grid control combo box. I think Roberto had done it on purpose.

1. The grid control internally stores the numeric index of the array item (and not the item) even though it shows the array item in the grid control. ie., if we have {"Sunday","Monday","Tuesday","Wednesday"....} as our array and if we select "Tuesday", the index of the item (ie., 3) only is maintained by the grid control. The grid item property also returns the numeric value and not the array item.

2. aSort() and windows api sorting for combobox might be different. So, even though you pass on a sorted array, if you have the 'sort' property in the combobox, the item place might have been changed giving wrong results.

So, we have to resolve this before having the 'sort' property in the grid control combobox.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
sudip
Posts: 1454
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: Sort property in Grid Combobox

Post by sudip »

Hello Rathi,

Yes you are correct :)

But, SORT propertoy of ordinary Combobox control has another very significant advantage - incremental search.

Practically, in most of my apps, aSort() function or "ORDER BY" clause in SQL - send sorted arrays to Grid Comboboxes. But, there is no incremental search like your achoice code or CSB. Achoice or CSB is more advanced in the sense that 1) we can edit text box value, 2) value is text not integer and 3) we can have a choice of without selecting any item.

Again, if we have sort property in Grid Combobox control, incremental search will be very easy. If not possible, no problem -you already showed us how to use achoice with Grid :D

BTW, I also use Grid control itself (not celled) for incremental search ;) And after recent experiment with browse control, I found, this cannot be done with Browse - where record pointer cannot be changed without using Arrow keys or mouse click. ;) (and for that reason, onece I requested Roberto for non-celled grid with table)
With best regards,
Sudip
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Sort property in Grid Combobox

Post by Rathinagiri »

Incremental search within grid (using combobox) would be possible, if the value returned is array item and not the integer numeric index. This would change the very basic feature of the grid control and require much of source code change.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
sudip
Posts: 1454
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: Sort property in Grid Combobox

Post by sudip »

rathinagiri wrote:Incremental search within grid (using combobox) would be possible, if the value returned is array item and not the integer numeric index.
:)
rathinagiri wrote:This would change the very basic feature of the grid control and require much of source code change.
:(

Thank you friend :)
With best regards,
Sudip
Post Reply