Forum  Commercial Foru...  Commercial Foru...  DragDrop ListView
Previous Previous
 
Next Next
New Post 6/6/2012 1:06 PM
  grsgrs
39 posts
No Ranking


DragDrop ListView 

Hi

I tried to use Drag Drop with ListView. OnDrop I get a X/Y Position but not any information about the row and the column the data are dropped on. But without that , DragDrop on Listview does not make much sense. How can I achieve this information?

Thanks

Gunter

 

 
New Post 6/6/2012 2:26 PM
  JamesC
850 posts
www.redcastle.co.uk
1st Level Poster




Re: DragDrop ListView 

Hi Gunter - here''s some sample code for drag-dropping one listviewitem onto another in the same listview

cheers james

        private void Form1_Load(object sender, EventArgs e)        {
            listView1.Columns.Add(new ColumnHeader("drag drop sample"));
            listView1.DragDrop += new DragEventHandler(listView1_DragDrop);
            Gizmox.WebGUI.Forms.Component[] dragtargets = new Gizmox.WebGUI.Forms.Component[1];
            dragtargets[0] = listView1 as Gizmox.WebGUI.Forms.Component;
            listView1.FullRowSelect = true;
            listView1.AllowDrop = true;
            for (int i = 0; i < 5; i++)
            {
                ListViewItem itmX = new ListViewItem(i.ToString());
                itmX.DragTargets = dragtargets;
                listView1.Items.Add(itmX);
            }
        }

        void listView1_DragDrop(object sender, DragEventArgs e)
        {
            DragDropEventArgs dde = e as DragDropEventArgs;
            ListViewItem itmDrop = dde.TargetMember as ListViewItem;
            ListViewItem itmDrag = dde.SourceMember as ListViewItem;
            MessageBox.Show("you dropped item " + itmDrag.Text + " onto item " + itmDrop.Text);
        }

 
New Post 6/6/2012 2:39 PM
  palli
14324 posts
1st Level Poster




Re: DragDrop ListView 

 Hi Gunter,

Please see what we have written on this subject in the breaking changes document here. It should answer most of your questions. 

Feel free to come back and ask for further clarifications if anything is unclear.

Hope this helps,

Palli

 


Páll Björnsson - Visual WebGui support team - Email: support@visualwebgui.com
 
Previous Previous
 
Next Next
  Forum  Commercial Foru...  Commercial Foru...  DragDrop ListView
.NET HTML5 Web, Cloud and Mobile application delivery | Sitemap | Terms of Use | Privacy Statement | Copyright © 2005-2012 Visual WebGui®       Visual WebGui weblog on ASP.NET Gizmox Blog Visual WebGui Group on LinkedIn Visual WebGui updates on Twitter Visual WebGui Page on Facebook Visual WebGui YouTube Channel Visual WebGui Platform News RSS