Hi,
I have a Advanced DataGrid for displaying the number of rows from the Database and one row strictly should not allowed drag option. Is is possible? Please share one sample example.
Thanks, Ravi
Hi,
I have a Advanced DataGrid for displaying the number of rows from the Database and one row strictly should not allowed drag option. Is is possible? Please share one sample example.
Thanks, Ravi
Of course this is possible. Add a dragEnter Handler to your datagrid:
<mx:AdvancedDataGrid id="adg" dragEnabled="true" dragEnter="adg_dragEnterHandler(event)" />
With the following code:
protected var _draggedItem:Object;
protected function adg_dragEnterHandler(event:DragEvent):void
{
event.preventDefault();
event.currentTarget.hideDropFeedback(event);
var items:Array = ds.dataForFormat("items") as Array;
if (items != null && items.length > 0 && (items[0] is CategoryVO)) {
_draggedItem = Object(items[0]);
}
// Prevent item from being dragged
if (_draggedItem.property == true) {
DragManager.showFeedback(DragManager.NONE);
return;
}
DragManager.acceptDragDrop(UIComponent(event.currentTarget));
}
_draggedItem.property == true is the check, if an item can't be dragged.