Forum Discussion

sudhir_optima's avatar
sudhir_optima
Contributor
13 years ago

How to drag fields to some position

We have Field tree which contan no of fields like



Revenue

Production

Sale

Product

Category.



We are selecting few field depending upon our requirement ( it may be with shift key or with control key) and droping it certain position.

But the available field may vary.So we have written a generic function in whihc we are mentioning the field whihc we want to drop.



We have written a sepreate function to select the field items and another for dropping it to certain position.For dropping the function writen accepts the four position (a,b,c,d) a,b is selected field position  and c,d for dropped position.



But select field position may vary depending upon the selcted items. So here my question is how to find the x,y position ( here a,b) of the selected fields or how to move only selected items rather than passing their position ?


3 Replies

  • Hi,



    You need to calculate coordinates of the item you want to drag. Check the control you're working with in the Object Browser and find its native properties or methods (see the Ways to Interact With Application Objects help topic) which will allow you to access information on its items and their properties. By iterating through the item collection, find the needed item, get its bounds and use them to calculate drag coordinates.



    If you don't know which properties and methods to use, I recommend that you refer to your control's documentation or ask your developers how to get bounds of individual items.