Able to drag drop items of combobox but want to disable 1st item

Hello Sir,
I am able to drag drop elements of the combobox.
Here is my code...
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" xmlns:local="*" xmlns:utils="adobe.utils.*" xmlns:controls="qs.controls.*" initialize="init()">
<mx:Script>
<![CDATA[
import mx.events.DragEvent;
import mx.events.ListEvent;
import mx.controls.dataGridClasses.DataGridColumn;
import mx.controls.ComboBox;
import mx.controls.Alert;
[Bindable]
public var str:String = "";
public var comboLength:int;
public function init():void
var xml:XML = <test>
<col>
<col1>one</col1>
</col>
<col>
<col1>two</col1>
</col>
<col>
<col1>three</col1>
</col>
<col>
<col1>four</col1>
</col>
<col>
<col1>five</col1>
</col>
<col>
<col1>six</col1>
</col>
<col>
<col1>seven</col1>
</col>
  </test>;
  cb1.dataProvider = xml;
  comboLength = xml.col.length();
  cb1.rowCount = comboLength;
  str = (xml.col[0].col1.toString());
  cb1.prompt = str;
public function closeHandler(event:Event):void
if(MouseEvent.DOUBLE_CLICK)
// Alert.show("Click Event");
public function changeHandler(event:ListEvent):void
// Alert.show("Single Click Event");
public function doubleClickEvent(event:MouseEvent):void
Alert.show(event.currentTarget.toString());
Alert.show(event.target.toString(),"Double Click");
public function dragEnterFunction(event:DragEvent):void
Alert.show(event.target.parent.toString());
]]>
</mx:Script>
<mx:ComboBox id="cb1" prompt="prashant" doubleClickEnabled="true" doubleClick="doubleClickEvent(event)"
close="closeHandler(event)" dragEnter="dragEnterFunction(event)" >
<mx:itemRenderer>
<mx:Component>
<mx:DataGrid itemClick="outerDocument.cb1.text = this.selectedItem.col1.toString();itemSelected(event)"
dragEnabled="true" dropEnabled="true" dragDrop="draDropHandler(event)" dragMoveEnabled="true" headerHeight="0" showHeaders="false"
creationComplete="init()" click="clickable()"
itemDoubleClick="doubleClickEvent(event)">
<mx:columns>
<mx:DataGridColumn dataField="col1" headerText="" id="da" disabledColor="white"  />
</mx:columns>
<mx:Script>
<![CDATA[
import mx.controls.DataGrid;
import mx.events.DropdownEvent;
import mx.events.ListEvent;
import mx.events.DragEvent;
import mx.controls.Label;
import mx.controls.Alert;
public function clickable():void
//Alert.show("clickable");
public function itemSelected(event:ListEvent):void
Alert.show(event.itemRenderer.data.col1,"Single Click");
     public function draDropHandler(event:Event):void
Alert.show(event.target.parent.toString());
public function dragEnterFunction(event:DragEvent):void
Alert.show(event.target.parent);
override public function set data( value:Object ) : void
this.dataProvider = value.col;
//outerDocument.cb1.text = this.selectedItem.col1.toString()
//myList.addEventListener(ListEvent.ITEM_DOUBLE_CLICK, onItemDoubleClick,
public function doubleClickEvent(event:ListEvent):void
Alert.show(event.itemRenderer.data.col1,"Double Click");
]]>
</mx:Script>
</mx:DataGrid>
</mx:Component>
</mx:itemRenderer>
</mx:ComboBox>
</mx:Application>
But now i want to disable drag drop of the 1st item and the last item.
And also add double click of each item.
Can someone please help me out.
Awaiting your reply.
Thanks in advance.

Hello Sir,
Thanks a lot for your reply.
I have implemented some thing can you please help me out with this?
In this can you help me out with the double click event????
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"
xmlns:local="" xmlns:utils="adobe.utils." xmlns:controls="qs.controls.*"
initialize="init()">
<mx:Script>
<![CDATA[
import mx.events.DragEvent;
import mx.events.ListEvent;
import mx.controls.dataGridClasses.DataGridColumn;
import mx.controls.ComboBox;
import mx.controls.Alert;
import mx.controls.listClasses.ListBase;
import mx.core.UIComponent;
public var str:String = "";
public var comboLength:int;
public function init():void
var xml:XML =
</mx:Application

Similar Messages

  • Drag & drop item within Tree not working

    Hi,
    I want to be able to drag & drop items within a tree but
    items cannot move accross branches
    It can only be moved within its branch.
    For this I have a condition in dragDrop(event) handler.
    When i drag item it does not move accross branches which is
    intended but when i drop within its branch
    on a different location,
    the item does
    not get dropped
    Though i have dragMoveEnabled set to true.
    my code looks like this:
    private function onDragDrop(event:DragEvent):void {
    var dropTarget:Tree = Tree(event.currentTarget);
    var node:XML = myTree.selectedItem as XML;
    var p:*;
    p = node.parent();
    if(node.parent().@label != "sameBranch") {
    return;
    } else {
    // drop target.
    Do i need to do anything else...
    Please advice.
    Thanks
    Lucky

    topping up, still did not find a way to do...
    but i have handled all tree events like dragEnter and
    dragDrop as described in the flex doc.
    Has anyone faced a similar issue...

  • I want to be able to drag/drop to my iPhone

    Hi there. I have a 2G original iPhone with 3.1.3 and the latest version of iTunes.
    Currently I am synced only to my Macbook. I want to be able to drag/drop music and videos right to my iPhone instead of going through my iTunes library but I can't do it because all the music in my iPhone is gray.
    Here is an image of what happens - http://regmedia.co.uk/2007/07/09/iphone3.jpg
    Thanks

    You can transfer music and videos via the iTunes sync process, or manually manage music and videos with an iTunes library on a single computer only. You can do one or the other, not both at the same time. If you want to manually manage music and videos, this is selected under the Summary tab for your iPhone sync preferences with iTunes. If this content was transferred to your iPhone via the iTunes sync process previously, switching to manually manage music and videos will erase all iTunes content from your iPhone first. You cannot manually manage music and videos with an iTunes library on multiple computers as is possible with an iPod that supports disk mode.

  • Not able to drag WEB items into the Layout. What can be the issue?

    Hi all
    I am not able to drag WEB items into the Layout. Is it a Basis issue? Or some changes in the settings need gto be done.
    Thanks

    Solved my own problem.  Didn't realize I had to export the preview file from iBooks author.  Once I did that, I was able to select that file within the preview box.

  • How do I drag & drop items to toolbar using iPad?

    How do I drag &amp; drop items to toolbar using iPad?

    If you mean the Bookmarks Bar (not the toolbar above it) you can add items to that by choosing Bookmark from the Share icon (rectangle with arrow coming out of it) and then choosing to add the bookmark to the Bookmarks Bar section in the popup that appears.

  • No longer able to drag & drop to desktop..

    I was hoping someone here could help me.
    My son thought he (we) would like to try a new finder type app.
    I told him (after 2 days) that he could do this on "his computer" not mine.
    Once he removed the application and put everything back in order.........
    I no longer can drag & drop images to the desktop?!?
    He has no clue and I am praying that someone with smarter skills than me can help me out.
    Thanks in advance

    Move the com.apple.finder.plist file out of your users /Library/Preferences/ folder to the Desktop, OPTION-click & hold the Finder's Dock icon, select Relaunch, and see if that fixes the problem. If so, delete the moved file and reset your other Finder preferences. If you don't remember how you had things, check the Finder's preferences via Finder->Preferences. If this doesn't fix the issue, create a new admin user account, log into it, and see if the problem persists there.
    Once you resolve the issue, ban your son from your computer.

  • Drag & Drop from the Bridge to CS2 apps

    A great feature for the Bridge would be having the ability to Drag & Drop directly from the Bridge WITHOUT opening the files to other CS apps. This could work much like InDesign "Book Items" buy would be for entire suite.

    But you have to have the files open. I would like to be able to Drag & Drop, directly from the Bridge. IE not having the file open. The same way Book Items work in InDesign. If you have an EPS file, saved in the Book Items, all you have to do is Drag it into your indd file.

  • AdvancedDataGrid Drag Drop Error

    I'm running into an issue where AdvancedDataGrid is not
    accepting drag and drop from controls that do not implement
    dataprovider in HierarchicalData format. If i change the ADG's
    dataprovider to a flat arraycollection then it will be able to
    receive drag drop from other controls. I've tried overridding the
    drag events to accept the drops but that still does not work. What
    key info am i missing to get a HierarchicalData format ADG to
    accept drag drop items from other controls?

    5 years late, but I just ran across the same issue and this is what worked for me:
    protected function dragOverHandler(event:DragEvent):void {
        event.preventDefault();
        DragManager.showFeedback(DragManager.COPY);
        AdvancedDataGrid(event.currentTarget).showDropFeedback(event);

  • Can't drag/drop MP4 files in iTunes 10 - Movies

    Recently I have installed the new iTunes 10. Now I am not able to drag and drop MP4 files to load videos in my iPod and iPhone. Earlier I used to drag & drop MP4 files and load my iPod. But with this new version in Windows 7 OS, I am not able to load videos. Became very frustrated. Can you please help me?
    Thanks in advance!
    Prasenjit

    I have the same problem! Is there anyone out there with an answer! I'm so extremely frustrated with this issue. I did everything that others have suggested on this community and others online. I used a converter (which doesn't even make any sense because I used to be able to drag/drop mp4 with ease without converting them before this stupid iOS5 and Itunes update). I renamed the file to m4v. There's tons of stuff I tried and still nothing. What frustrates me is that everyone is suggesting to convert and as I said I never used to do that with MP4's before. Why all of a sudden now?

  • Home Sharing between Mac & PC - Can't drag & drop from one to the other.

    I have a Mac & a PC. I turned on home sharing and it works well, except that I want to copy all of the music on the Mac over to the PC. With Home Sharing active, you should be able to drag & Drop, but I can't. I read the help article and it says that the computer icon of the remote computer that you are sharing from should be in the left pane under Shared in iTunes. I don't see this. I only see my library.
    Any suggestions?

    these reads may be helpful:one and two.
    JGG

  • Cannot Drag & Drop Audio Files from iTunes into Project Timeline

    Hello,
    I have an iMovie (10.0.6) project open. I click the iTunes icon to fetch an audio track and it won't allow me to drag/drop it into the timeline. Yet it allows me to drag/drop other tracks from the same playlist (all from the same CD). All tracks are the same file type and about the same size/length, yet one of them (the one i want) cannot be dragged/dropped into the timeline. This happened with another iMovie project recently (different tracks from a different CD, but same idea: can't drag/drop one track, but i'm able to drag/drop others).
    Your help is appreciated!

    I've having the same issue. Very frustrating. FFS Apple!

  • Drag & Drop Text into place holder while Matching  style. Possible?

    Is it possible to drag text into a placeholder text box and have the dragged text assume the style of the placeholder text? I know that I can "paste and match style" which I use constantly but I am trying to build a template for other people to use and would love for them to simply be able to drag & drop text into a template. It seems like this would be the default behavior for a template but it does not seem to be.
    Am I missing something obvious?
    -joey
    G5 Quad   Mac OS X (10.4.8)  

    Eric Brooks wrote:
    I either have to select, copy, and then paste matching formatting, or drag, drop and then reformat the text from the styles. Is there any way I can drag and drop so that the text being dropped picks up the formatting of the place holder I'm dropping it into? It seems to me that this is what a placeholder should be for.
    Am I missing something?
    Perhaps the fact that the definition of placeholder is not the same for you and for the Pages designers
    Seriously, I think that you hit a design flaw. Here we are end users trying to help end users. We are unable to change the program behavior.
    _Go to "Provide Pages Feedback" in the "Pages" menu_, describe what you wish.
    Then, cross your fingers, and wait _at least_ for iWork'09
    Yvan KOENIG (from FRANCE jeudi 19 juin 2008 21:23:23)

  • How i can do a drag drop between container (grid)?

    I am trying to work out a task with Drag and Drop(WPF ,C#)to include in a demo ,i will explain easy showing an example of code in XAML 
    <Grid x:Name="LayoutRoot">
    <Grid.RowDefinitions>
    <RowDefinition Height="*"/>
    <RowDefinition Height="*"/>
    <RowDefinition Height="*"/>
    </Grid.RowDefinitions>
    <Grid x:Name="container1" Grid.Row="0" >
    <Grid Name="grid1" Background="Aqua" Margin="15"></Grid>
    </Grid>
    <Grid x:Name="container2" Grid.Row="1" >
    <Grid Name="grid2" Background="blue" Margin="15"></Grid>
    </Grid>
    <Grid x:Name="container3" Grid.Row="2" >
    <Grid Name="grid3" Background="green" Margin="15"></Grid>
    </Grid>
    </Grid>
    My purpose is when the user drag the
    grid1 in the
    container2 automatically the grid2 will go to place in the
    container1 (basically I want to swap the grids) then this process will be used every time need to drag a grid in a container. with a code that i wrote down i can do a simple drag&drop  i can drag the "grid1"
    to the "container2" but cannot send back automatically the grid2 to container1.
    Kindly i ask if you have any advise or tips to make successful this task.
    Thank you so much for your attention
    Cheers!!!
    *********EDIT*********                                                                  
                                     Using this code as follow i can do the drag&drop but what really i need is the grid "container "is fix and never move just the
    "grid" should move between the "container "                                 
    <StackPanel Name="sp" AllowDrop="True" Background="SkyBlue" PreviewMouseLeftButtonDown="sp_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="sp_PreviewMouseLeftButtonUp" PreviewMouseMove="sp_PreviewMouseMove"
    DragEnter="sp_DragEnter" Drop="sp_Drop">
    <Grid Name="grid1" Background="Aqua" Height="120" Width="500"></Grid>
    <Grid Name="grid2" Background="Blue" Height="120" Width="500"></Grid>
    <Grid Name="grid3" Background="Red" Height="120" Width="500"></Grid>
    </StackPanel>
    private bool _isDown;
    private bool _isDragging;
    private Point _startPoint;
    private UIElement _realDragSource;
    private UIElement _dummyDragSource = new UIElement();
    public MainWindow()
    InitializeComponent();
    private void sp_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
    if (e.Source == this.sp)
    else
    _isDown = true;
    _startPoint = e.GetPosition(this.sp);
    private void sp_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
    _isDown = false;
    _isDragging = false;
    _realDragSource.ReleaseMouseCapture();
    private void sp_PreviewMouseMove(object sender, MouseEventArgs e)
    if (_isDown)
    if ((_isDragging == false) && ((Math.Abs(e.GetPosition(this.sp).X - _startPoint.X) > SystemParameters.MinimumHorizontalDragDistance) ||
    (Math.Abs(e.GetPosition(this.sp).Y - _startPoint.Y) > SystemParameters.MinimumVerticalDragDistance)))
    _isDragging = true;
    _realDragSource = e.Source as UIElement;
    _realDragSource.CaptureMouse();
    DragDrop.DoDragDrop(_dummyDragSource, new DataObject("UIElement", e.Source, true), DragDropEffects.Move);
    private void sp_DragEnter(object sender, DragEventArgs e)
    if (e.Data.GetDataPresent("UIElement"))
    e.Effects = DragDropEffects.Move;
    private void sp_Drop(object sender, DragEventArgs e)
    if (e.Data.GetDataPresent("UIElement"))
    UIElement droptarget = e.Source as UIElement;
    int droptargetIndex=-1, i =0;
    foreach (UIElement element in this.sp.Children)
    if (element.Equals(droptarget))
    droptargetIndex = i;
    break;
    i++;
    if (droptargetIndex != -1)
    this.sp.Children.Remove(_realDragSource);
    this.sp.Children.Insert(droptargetIndex, _realDragSource);
    _isDown = false;
    _isDragging = false;
    _realDragSource.ReleaseMouseCapture();
    Thanks :)

    Hello Jonny,
    Currently I do not have a sample and I have reviewed this post and find another way which seems more reasonable. Have you cosidered use a ListView instead of common grid. It seems we can do what you want with two common grid however we need to hardcoded
    all the things.
    If we use ListView, for example, you can see this thread:
    http://stackoverflow.com/questions/20573063/creating-icon-view-mode-for-listview-wpf
    and this thread:
    http://stackoverflow.com/questions/9443695/how-do-i-drag-drop-items-in-the-same-listview
    We can drag and drop items instead of grid, which will make this programming much easier than hard code to switch your control's location.
    Best regards,
    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.
    Dear Barry Wang thank you so much for your kind support ,just open me a way to do it ,you can see in this post https://social.msdn.microsoft.com/Forums/vstudio/en-US/55873851-e86c-4a20-9b00-de3419054ba8/get-stuck-to-dragdrop-in-this-case?forum=wpf .
    Wish you a Happy New Year .
    Sincerley

  • Drag & drop albums not working in iphoto

    I am using iphoto 11 version 9.4.2  I used to be able to drag & drop my albums into a preferred order.  Now when I try to move a particular album within the album section by dragging & dropping, a new folder is created containing the album I was trying to move.  How can I move albums into a particular order.  Why are folders being created when I try to move albums?

    I'm able to sort albums both way, inside folders and those out of folders. The feature exists.  As a test launch iPhoto with the Option key held down and create a new, test library.  Import some photos, create a number of albums and albums in a folder and test to see if the same problem persists. Does it?  I'm running iPhoto 9.4.3 on 10.8.4.
    OT

  • Drag & drop to other programs won't work

    Today i installed firefox 24. I tried to drag & drop a picture from google pictures to the program tag & rename. That didn't work.
    Drag & drop to my desktop works ok.
    Drag & drop from internet explorer to tag & rename works fine.
    Till today i had a nightly firefox and there drag & drop works fine. But after the last update from the nightly firefox was a lot slower.
    So i got back to firefox 24.
    I have a 64 bit pc with windows 8.
    I hope someone can help me
    Ronald

    I tried what you said and it is true that the image directly dragging out a white box, but I'll give you a solution to see if it works. Instead of dragging the image directly, first select "View Image", and once you open the image in the browser, drag image to the document. In this way I have not had any problems with the images and the websites I've tried.
    You can download the latest version of Firefox from my site ''(link removed by moderator)''
    Greetings!!

Maybe you are looking for