Thread View: borland.public.cppbuilder.database.ado
4 messages
4 total messages
Started by Daryl
Tue, 05 Apr 2005 09:09
TDBLookupListBox - Moving items in list
Author: Daryl
Date: Tue, 05 Apr 2005 09:09
Date: Tue, 05 Apr 2005 09:09
27 lines
1427 bytes
1427 bytes
Cross post - no responses from Compoment Using list... I would like to know if it is possible to allow a user to select a record and then move its position in the list (either up or down) by use of a button click. Of course this list is derived from a dataset. Example: List contains. Cars 12 Boats 10 Bikes 2 Actions: The user selects (highlights) Bikes 2 The user clicks the MOVE UP button Outcome: The List now reads, and Bikes 2 is still highlighted. Cars 12 Bikes 2 Boats 10 Any help would be good. thanks daryl
Re: TDBLookupListBox - Moving items in list
Author: John Scott
Date: Tue, 05 Apr 2005 15:45
Date: Tue, 05 Apr 2005 15:45
35 lines
1999 bytes
1999 bytes
Add another field to the dataset and use the data in this field to sort the data in the dataset. You can then manipulate the data in this field to change the sort order. John "Daryl" <developeracc@hotmail.com> wrote in message news:42525622@newsgroups.borland.com... > > Cross post - no responses from Compoment Using list... > > I would like to know if it is possible to allow a user to select a > record and then move its position in the list (either up or down) by > use of a button click. Of course this list is derived from a > dataset. > > Example: > List contains. > Cars 12 > Boats 10 > Bikes 2 > > Actions: > The user selects (highlights) Bikes 2 > The user clicks the MOVE UP button > > Outcome: > The List now reads, and Bikes 2 is still highlighted. > Cars 12 > Bikes 2 > Boats 10 > > Any help would be good. > > thanks > daryl
Re: TDBLookupListBox - Moving items in list
Author: Daryl
Date: Tue, 05 Apr 2005 20:40
Date: Tue, 05 Apr 2005 20:40
60 lines
3069 bytes
3069 bytes
Yes, I have tried to do what you suggest but for me I had the following problems. The item selected (highlighted) in the listbox did not want to automatically follow the record being moved say toward the top of the list and the control appears to have no method to allow the programmer to select/highlight a record in the list. Also, I found it difficult to cleanly change the value being used to sort the recordset. It is easy enough to say decrement the value of the current selected record but then you have to find the record of now the same value and increment it. This should be the prior record - when you code this to me it looks clumsy and as I indicated the selected/highlighted record does not move up in the list. It seems to stay on the same record position in the list ie if the third record is selected/highlighted then when it supposed to move to position two in the list (it does) but the record now at position three in the list is selected/highlighted. I hope this makes sense, thanks for the response. daryl "John Scott" <jscott@kw.igs.net> wrote in message news:4252b2b9@newsgroups.borland.com... > Add another field to the dataset and use the data in this field to > sort the data in the dataset. You can then manipulate the data in this > field to change the sort order. > > John > "Daryl" <developeracc@hotmail.com> wrote in message > news:42525622@newsgroups.borland.com... > > > > Cross post - no responses from Compoment Using list... > > > > I would like to know if it is possible to allow a user to select a > > record and then move its position in the list (either up or down) by > > use of a button click. Of course this list is derived from a > > dataset. > > > > Example: > > List contains. > > Cars 12 > > Boats 10 > > Bikes 2 > > > > Actions: > > The user selects (highlights) Bikes 2 > > The user clicks the MOVE UP button > > > > Outcome: > > The List now reads, and Bikes 2 is still highlighted. > > Cars 12 > > Bikes 2 > > Boats 10 > > > > Any help would be good. > > > > thanks > > daryl >
Re: TDBLookupListBox - Moving items in list
Author: John Scott
Date: Thu, 07 Apr 2005 15:02
Date: Thu, 07 Apr 2005 15:02
84 lines
3745 bytes
3745 bytes
I beleive that when I did this I used bookmarks to remember the two records where I wanted to exchange the keys. You must take care of the exceptions - i.e. trying to move the top record up or last record down, or if there is only one record. John "Daryl" <developeracc@hotmail.com> wrote in message news:4252f69e$1@newsgroups.borland.com... > Yes, I have tried to do what you suggest but for me I had the > following > problems. > > The item selected (highlighted) in the listbox did not want to > automatically > follow the record being moved say toward the top of the list and the > control > appears to have no method to allow the programmer to > select/highlight a > record in the list. > > Also, I found it difficult to cleanly change the value being used to > sort > the recordset. It is easy enough to say decrement the value of the > current > selected record but then you have to find the record of now the same > value > and increment it. This should be the prior record - when you code > this to > me it looks clumsy and as I indicated the selected/highlighted > record does > not move up in the list. It seems to stay on the same record > position in > the list ie if the third record is selected/highlighted then when it > supposed to move to position two in the list (it does) but the > record now at > position three in the list is selected/highlighted. > > I hope this makes sense, thanks for the response. > > daryl > > "John Scott" <jscott@kw.igs.net> wrote in message > news:4252b2b9@newsgroups.borland.com... >> Add another field to the dataset and use the data in this field to >> sort the data in the dataset. You can then manipulate the data in >> this >> field to change the sort order. >> >> John >> "Daryl" <developeracc@hotmail.com> wrote in message >> news:42525622@newsgroups.borland.com... >> > >> > Cross post - no responses from Compoment Using list... >> > >> > I would like to know if it is possible to allow a user to select >> > a >> > record and then move its position in the list (either up or down) >> > by >> > use of a button click. Of course this list is derived from a >> > dataset. >> > >> > Example: >> > List contains. >> > Cars 12 >> > Boats 10 >> > Bikes 2 >> > >> > Actions: >> > The user selects (highlights) Bikes 2 >> > The user clicks the MOVE UP button >> > >> > Outcome: >> > The List now reads, and Bikes 2 is still highlighted. >> > Cars 12 >> > Bikes 2 >> > Boats 10 >> > >> > Any help would be good. >> > >> > thanks >> > daryl >> > >
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads