Drag Drop functionality in grid, .net
How can i implement drag drop functionality in Component 1 Flex grid. Also the grid should allow some functionalities related to dragged data like
Allow deletion of dragged data in cells of Grid.
Dragged item remains in original cell as well and in the cell where it is dragged to. If the original item is deleted, the dragged item also gets deleted. Grid should not allow data to be duplicated in same column.Please can anyone help me or suggest me that how is it possible in flex grid. It is a windows based application. So if any possibility of doing the same using win开发者_Go百科dows application basic functionality as well then please let me know.
you can simply use this
All drag & drop settings are contained in Grid.DragAndDrop property. The following properties should be set to true to use drag & drop feature:
Grid.AllowDrop = true;
Grid.DragAndDrop.Enabled = true;
Well, I don't have any direct knowledge of this component, but I'll give it a try, based on some winforms experience (is web development still "winforms"? Flex seems to be something for web development...), hopefully to provoke further discussion. Taking your points as an alphabulleted list:
A) To remove controls from a container, use the "Remove" method.
B) This generally doesn't work. Adding a control to a container twice will probably either move it or do nothing. You'll probably need to copy the control and add the copy to the grid.
C) You'll need to create a link between the two controls, perhaps by storing a list of parent->child relationships. When the parent is deleted, you'll need to read the list, note that the parent is being deleted, and delete the child at the same time.
D) Do a check of the contents of the column, when attempting to insert, to see whether the column contains the parent of the copy you are trying to insert, or another child of the same parent. If so, cancel the insert.
Hope some of this helps.
精彩评论