Article View: borland.public.cppbuilder.database.ado
Article #759Re: TDBLookupListBox - Moving items in list
From: 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 >> > >
Technical Details
Message-ID:
<42554b6d@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<42525622@newsgroups.borland.com> <4252b2b9@newsgroups.borland.com> <4252f69e$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,c95d01d80e9ee5ae X-Google-Attributes: gid10698b,public X-Google-Language: ENGLISH,ASCII-7-bit From: "John Scott" <jscott@kw.igs.net> Newsgroups: borland.public.cppbuilder.database.ado References: <42525622@newsgroups.borland.com> <4252b2b9@newsgroups.borland.com> <4252f69e$1@newsgroups.borland.com> Subject: Re: TDBLookupListBox - Moving items in list Date: Thu, 7 Apr 2005 11:02:05 -0400 Lines: 85 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 NNTP-Posting-Host: 216.16.227.165 Message-ID: <42554b6d@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1112886125 216.16.227.165 (7 Apr 2005 08:02:05 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail