Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Equivalent of AfterRowColChange in List Boxes
Message
From
14/10/2008 10:19:42
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01354517
Message ID:
01354811
Views:
15
> can't use a cursor/table


Ahh.. That's why I've never used it.


My code works on records that have an "order" column, and it just swaps the order value of the current record with the aft or fore record, and it relies on the records being indexed to include that field to show the records in the correct order.

This method also allows me to propertly sort the records on SQL queries also.





>Yes. Just set the "MoverBars" property to T.
>
>RowSourceType and RowSoure needs be 0 (none) or 1 (value).
>
>So source needs be value or array, so can't use a cursor/table.
>
>Event = OnMoveItem
>Method = MoveItem.
>
>>So the naitive list control has mover functionality built-in? I didn't know that.
>>
>>What properties are involved in activating this?
>>
>>
>>
>>
>>
>>>Thanks Matt. I think I have to move on now but I'll take a look at that functionality for future use. The client has already been shown screen shots of a mover list so I think I have to proceed on that basis.
>>>
>>>>I use this technique to do moving in a grid-based scenario... Outside of the grid, place two command buttons with this code shown below (make necessary modifications) :
>>>>
>>>>cmdUpButton.Click()
>>>>
>>>>Local nRecno, cTable, cField, cRef, cTest
>>>>
>>>>cTable=(thisform.table)
>>>>cField='Order'
>>>>cRef=cTable+'.'+cField
>>>>cTest='part_files.ifkey==parts.ipkey'
>>>>nRecno=recno()
>>>>
>>>>Select(cTable)
>>>>
>>>>n2=&cRef
>>>>if not bof()
>>>> skip -1
>>>> if &cTest
>>>>  n1=&cRef
>>>>  replace &cRef with n2
>>>>  goto nRecno
>>>>  replace &cRef with n1
>>>> else
>>>>  skip 1
>>>> endif
>>>>endif
>>>>
>>>>Goto Recno()
>>>>this.parent.grid1.setfocus()
>>>>
>>>>
>>>>
>>>>
>>>>cmdDownButton.Click()
>>>>
>>>>Local nRecno, cTable, cField, cRef, cTest
>>>>
>>>>cTable=(thisform.table)
>>>>cField='Order'
>>>>cRef=cTable+'.'+cField
>>>>cTest='part_files.ifkey==parts.ipkey'
>>>>nRecno=recno()
>>>>
>>>>Select(cTable)
>>>>
>>>>n2=&cRef
>>>>if not bof()
>>>> skip 1
>>>> if &cTest
>>>>  n1=&cRef
>>>>  replace &cRef with n2
>>>>  goto nRecno
>>>>  replace &cRef with n1
>>>> else
>>>>  skip -1
>>>> endif
>>>>endif
>>>>
>>>>Goto Recno()
>>>>this.parent.grid1.doscroll(0)
>>>>this.parent.grid1.setfocus()
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>Either I'm very rusty or it doesn't exist but is there an equivalent of the .AfterRowColChange() event in List Boxes?
>>>>>
>>>>>Because grids don't have mover buttons I'm displaying records in a list (the user needs to be able to change their order).
>>>>>
>>>>>But, as with a grid, I want the static fields on the form, pertaining to those in the list, to change as the user selects a different "row" in the list.
>>>>>
>>>>>IOW I want my list to behave like a grid.
>>>>>
>>>>>'ppreciate it.
>>>>>
>>>>>Terry
Previous
Reply
Map
View

Click here to load this message in the networking platform