PDA

View Full Version : Drag-and-Drop to select locked and unlocked grid columns



LarssaAndin
22 Jan 2014, 2:59 AM
I'm working on a feature for my application which goal is to make it possible to dynamically select which grid columns are locked. This feature can be found in most spreadsheet applications (like Excel and Google Docs). I know how to do control the grid on the configuration level, but don't really have a clue on how to create the drag-n-drop effects needed to handle the user interaction.

What I need to create is a (normally) invisible marker at the break point between locked and normal columns. When clicking the marker a visualization should appear (think of a thick line) going down from the header to the bottom of the view that can only be moved left and right to the edges of the grid view. When dropped somewhere I need to know what column is under that position so I can use this to update the grid.

So, what I need to figure out is how to place the marker at the correct place. How to limit the area where the visualization can be placed and to know what column is "selected" when dropping the selector.

Any suggestions on how to do this would be greatly appreciated.

scottmartin
28 Jan 2014, 4:37 PM
To not answer you question, but please note that when you lock a grid column, you are creating 2 grids at this point.